NA_plot(x, col = c("black","white"), xlab ="Time", ylab ="Component", text ="Black: NA; White: Available data", side =4, line =1, adj =0,...)
Arguments
x: matrix (ideally an xts object).
col: bivariate vector containing the colors for missing and available data, respectively.
xlab: x-axis label.
ylab: y-axis label.
text: see mtext(). The text = "", it is omitted.
side: see mtext().
line: see mtext().
adj: see mtext().
...: additional arguments passed to the underlying image().
Returns
invisible().
Details
Indicate NAs in a data set.
Author(s)
Marius Hofert
Examples
## Generate datan <-1000# sample sized <-100# dimensionset.seed(271)# set seedx <- matrix(runif(n*d), ncol = d)# generate data## Assign missing datak <- ceiling(d/4)# fraction of columns with some NAsj <- sample(1:d, size = k)# columns j with NAsi <- sample(1:n, size = k)# 1:i will be NA in each column jX <- x
for(k. in seq_len(k)) X[1:i[k.], j[k.]]<-NA# put in NAs## Plot NAsNA_plot(X)# indicate NAs