image
plot of a pattern of missing values.
plot.miss(x, transpose = F, all.obs = T, sort.obs = T, labels = T, ...)
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.
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.
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.
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
.
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.
par("cex")
.
However the size may be reduced to make labels fit on the plot.
printer
this function will call
print.miss
instead of failing (but
arguments to this function are ignored).
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.
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.