Graphically displays pattern of missing data

DESCRIPTION:

image plot of a pattern of missing values.

USAGE:

plot.miss(x, transpose = F, all.obs = T, sort.obs = T, 
          labels = T, ...) 

REQUIRED ARGUMENTS:

x
a miss object (e.g. created by miss(y)). This may also be a matrix or data frame, in which case miss is called to create a miss object.

OPTIONAL ARGUMENTS:

transpose
if TRUE then variables (columns of the original data) correspond to rows of the plot. This may produce better images, because variable labels are horizontal and the rectangles for individual data points may be more nearly square.
all.obs
if TRUE then missing value patterns for all observations (rows of the original data) are shown, if FALSE then only unique patterns are shown. all.obs can also be a number between 0.0 and 1.0, in which case the unique patterns are shown with width (or height, if transpose = FALSE) proportional to the all.obs power of the number k of observations that match the pattern. For example, if all.obs = 0.5, then the width (height) is proportional to the square root of k.
sort.obs
if TRUE then observations are ordered by miss. If FALSE then the observations are ordered as in the original data. This argument is ignored if all.obs is anything other than TRUE.
labels
if TRUE then variable labels are printed. If there are many variables the labels may be indistinguishable. If there is room the labels are parallel to the axes. If labels is a number then labels=2 forces labels to be parallel to the axes, otherwise they are perpendicular to the axes.
...
In addition, the high-level graphics arguments described under and the arguments to may be supplied to this function. In particular, the size of variable labels is affected by par("cex"). However the size may be reduced to make labels fit on the plot.

SIDE EFFECTS:

An image plot is produced on the current graphics device. The plot will fail if the current device does not support image(). If there is no current device or if the device is printer this function will call print.miss instead of failing (but arguments to this function are ignored).

DETAILS:

Variables are ordered by miss.

This function is a method for the generic function plot for the class "miss". It can be invoked by calling plot for an object of class miss, or directly.

Colors or gray scales are determined by the current colors for image , where missing observations are 0 and nonmissing observations are 1.

SEE ALSO:

, , .

EXAMPLES:

y <- longley.x; y[ runif(96) > .9 ] <- NA  #Random missing data 
M <- miss(y) 
plot(M) 
plot(M, all.obs = F) 
plot(miss(y, sort = "r")) # Do not reorder variables 
plot(M, sort.obs = F)     # Observations are in their original order 
image(!is.na(y))          # Raw data, neither rows nor columns reordered 
plot(miss(y[rowSums(is.na(y))>0, ])) # skip rows with no missing obs.