Colored map in which the proportion or amount of missing/imputed values in each region is coded according to a continuous or discrete color scheme. The sequential color palette may thereby be computed in the HCL or the RGB color space.
colormapMiss(
x,
region,
map,
imp_index = NULL,
prop = TRUE,
polysRegion = 1:length(x),
range = NULL,
n = NULL,
col = c("red", "orange"),
gamma = 2.2,
fixup = TRUE,
coords = NULL,
numbers = TRUE,
digits = 2,
cex.numbers = 0.8,
col.numbers = par("fg"),
legend = TRUE,
interactive = TRUE,
...
)colormapMissLegend(
xleft,
ybottom,
xright,
ytop,
cmap,
n = 1000,
horizontal = TRUE,
digits = 2,
cex.numbers = 0.8,
col.numbers = par("fg"),
...
)
colormapMiss
returns a list with the following components:
nmiss a numeric vector containing the number of missing/imputed values in each region.
nobs a numeric vector containing the number of observations in each region.
pmiss a numeric vector containing the proportion of missing values in each region.
prop a logical indicating whether the proportion of missing/imputed values have been used rather than the total amount.
range the range of the proportion or amount of missing/imputed values corresponding to the color range.
n either a positive integer giving the number of equally spaced
cut-off points for a discretized color scheme, or NULL
for a
continuous color scheme.
start the start color of the color scheme.
end the end color of the color scheme.
space a character string giving the color space (either
"rgb"
for RGB colors or "hcl"
for HCL colors).
gamma numeric; the display gamma value (see
colorspace::hex()
).
fixup a logical indicating whether the colors have been
corrected to valid RGB values (see colorspace::hex()
).
a numeric vector.
a vector or factor of the same length as x
giving the
regions.
an object of any class that contains polygons and provides its
own plot method (e.g., "SpatialPolygons"
from package sp
).
a logical-vector indicating which values of ‘x’ have
been imputed. If given, it is used for highlighting and the colors are
adjusted according to the given colors for imputed variables (see
col
).
a logical indicating whether the proportion of missing/imputed values should be used rather than the total amount.
a numeric vector specifying the region that each polygon belongs to.
a numeric vector of length two specifying the range (minimum and maximum) of the proportion or amount of missing/imputed values to be used for the color scheme.
for colormapMiss
, the number of equally spaced cut-off
points for a discretized color scheme. If this is not a positive integer, a
continuous color scheme is used (the default). In the latter case, the
number of rectangles to be drawn in the legend can be specified in
colormapMissLegend
. A reasonably large number makes it appear
continuously.
the color range (start end end) to be used. RGB colors may be
specified as character strings or as objects of class
"colorspace::RGB()
". HCL colors need to be specified as objects
of class "colorspace::polarLUV()
". If only one color is
supplied, it is used as end color, while the start color is taken to be
transparent for RGB or white for HCL.
numeric; the display gamma value (see
colorspace::hex()
).
a logical indicating whether the colors should be corrected to
valid RGB values (see colorspace::hex()
).
a matrix or data.frame
with two columns giving the
coordinates for the labels.
a logical indicating whether the corresponding proportions or numbers of missing/imputed values should be used as labels for the regions.
the number of digits to be used in the labels (in case of proportions).
the character expansion factor to be used for the labels.
the color to be used for the labels.
a logical indicating whether a legend should be plotted.
a logical indicating whether more detailed information about missing/imputed values should be displayed interactively (see ‘Details’).
further arguments to be passed to plot
.
left x position of the legend.
bottom y position of the legend.
right x position of the legend.
top y position of the legend.
a list as returned by colormapMiss
that contains the
required information for the legend.
a logical indicating whether the legend should be drawn horizontally or vertically.
Andreas Alfons, modifications to show imputed values by Bernd Prantner
The proportion or amount of missing/imputed values in x
of each
region is coded according to a continuous or discrete color scheme in the
color range defined by col
. In addition, the proportions or numbers
can be shown as labels in the regions.
If interactive
is TRUE
, clicking in a region displays more
detailed information about missing/imputed values on the console. Clicking
outside the borders quits the interactive session.
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.
colSequence()
, growdotMiss()
,
mapMiss()