plotxna: Plotting Missing Data in a Matrix

View source: R/plotxna.R

plotxnaR Documentation

Plotting Missing Data in a Matrix

Description

Plot the location of missing data in a matrix.

Usage

plotxna(X, pch = 16, col = "red", grid = FALSE, asp = 0, ...)

Arguments

X

A n x p matrix or data frame.

pch

Type of point. See points.

col

A color defining the color of the points.

grid

Logical. If TRUE, a grid is plotted for representing the matrix rows an columns. Default to FALSE.

asp

Scalar. Giving the aspect ratio y/x. The value asp = 0 is the default in plot.default (no constraints on the ratio). See plot.default.

...

Other arguments to pass in functions plot.

Value

A plot.

Examples


data(datoctane)
X <- datoctane$X
n <- nrow(X)
p <- ncol(X)
N <- n * p

s <- sample(1:N, size = 50)
zX <- replace(X, s, NA)
plotxna(zX)
plotxna(zX, grid = TRUE, asp = 1)


mlesnoff/rnirs documentation built on April 24, 2023, 4:17 a.m.