NA_plot function

Graphical Tool for Visualizing NAs in a Data Set

Graphical Tool for Visualizing NAs in a Data Set

Plot NAs in a data set.

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 data n <- 1000 # sample size d <- 100 # dimension set.seed(271) # set seed x <- matrix(runif(n*d), ncol = d) # generate data ## Assign missing data k <- ceiling(d/4) # fraction of columns with some NAs j <- sample(1:d, size = k) # columns j with NAs i <- sample(1:n, size = k) # 1:i will be NA in each column j X <- x for(k. in seq_len(k)) X[1:i[k.], j[k.]] <- NA # put in NAs ## Plot NAs NA_plot(X) # indicate NAs
  • Maintainer: Marius Hofert
  • License: GPL (>= 3) | file LICENCE
  • Last published: 2024-03-04

Useful links