Description Usage Arguments Details Note Author(s) References Examples
Create a matrix plot, in which all cells of a data matrix are visualized by rectangles. Available data is coded according to a continuous color scheme, while missing/imputed data is visualized by a clearly distinguishable color.
1 2 |
x |
a matrix or |
delimiter |
a character-vector to distinguish between variables and
imputation-indices for imputed variables (therefore, |
hscale |
horizontal scale factor for plot to be embedded in a Tcl/Tk window (see ‘Details’). The default value depends on the number of variables. |
vscale |
vertical scale factor for the plot to be embedded in a Tcl/Tk window (see ‘Details’). The default value depends on the number of observations. |
TKRpar |
a list of graphical parameters to be set for the plot to be
embedded in a Tcl/Tk window (see ‘Details’ and
|
... |
for |
In a matrix plot, all cells of a data matrix are visualized by
rectangles. Available data is coded according to a continuous color scheme.
To compute the colors via interpolation, the variables are first scaled to
the interval [0,1]. Missing/imputed values can then be
visualized by a clearly distinguishable color. It is thereby possible to use
colors in the HCL or RGB color space. A simple way of
visualizing the magnitude of the available data is to apply a greyscale,
which has the advantage that missing/imputed values can easily be
distinguished by using a color such as red/orange. Note that -Inf
and Inf
are always assigned the begin and end color, respectively, of
the continuous color scheme.
Additionally, the observations can be sorted by the magnitude of a selected
variable. If interactive
is TRUE
, clicking in a column
redraws the plot with observations sorted by the corresponding variable.
Clicking anywhere outside the plot region quits the interactive session.
TKRmatrixplot
behaves like matrixplot
, but uses
tkrplot
to embed the plot in a Tcl/Tk window.
This is useful if the number of observations and/or variables is large,
because scrollbars allow to move from one part of the plot to another.
This is a much more powerful extension to the function imagmiss
in the former CRAN package dprep
.
iimagMiss
is deprecated and may be omitted in future versions of
VIM
. Use matrixplot
instead.
Andreas Alfons, Matthias Templ, modifications by Bernd Prantner
M. Templ, A. Alfons, P. Filzmoser (2012) Exploring incomplete data using visualization tools. Journal of Advances in Data Analysis and Classification, Online first. DOI: 10.1007/s11634-011-0102-y.
A. Kowarik, M. Templ (2016) Imputation with R package VIM. Journal of Statistical Software, 74(7), 1-16
1 2 3 4 5 6 7 8 9 10 | data(sleep, package = "VIM")
## for missing values
x <- sleep[, -(8:10)]
x[,c(1,2,4,6,7)] <- log10(x[,c(1,2,4,6,7)])
matrixplot(x, sortby = "BrainWgt")
## for imputed values
x_imp <- kNN(sleep[, -(8:10)])
x_imp[,c(1,2,4,6,7)] <- log10(x_imp[,c(1,2,4,6,7)])
matrixplot(x_imp, delimiter = "_imp", sortby = "BrainWgt")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.