Learn R Programming

VIMGUI (version 0.10.0)

TKRpbox: Parallel boxplots with information about missing/imputed values

Description

Boxplot of one variable of interest plus information about missing/imputed values in other variables.

Usage

TKRpbox(x, pos = 1, delimiter = NULL, hscale = NULL, vscale = 1, TKRpar = list(), ...)

Arguments

x
a vector, matrix or data.frame.
pos
a numeric value giving the index of the variable of interest. Additional variables in x are used for grouping according to missingness/number of imputed missings.
delimiter
a character-vector to distinguish between variables and imputation-indices for imputed variables (therefore, x needs to have colnames). If given, it is used to determine the corresponding imputation-index for any imputed variable (a logical-vector indicating which values of the variable have been imputed). If such imputation-indices are found, they are used for highlighting and the colors are adjusted according to the given colors for imputed variables (see col).
hscale
horizontal scale factor for plot to be embedded in a Tcl/Tk window (see ‘Details’). The default value depends on the number of boxes to be drawn.
vscale
vertical scale factor for the plot to be embedded in a Tcl/Tk window (see ‘Details’).
TKRpar
a list of graphical parameters to be set for the plot to be embedded in a Tcl/Tk window (see ‘Details’ and par).
...
for pbox, further arguments and graphical parameters to be passed to boxplot and other functions. For TKRpbox, further arguments to be passed to pbox.

Value

a list as returned by boxplot.

Details

This plot consists of several boxplots. First, a standard boxplot of the variable of interest is produced. Second, boxplots grouped by observed and missing/imputed values according to selection are produced for the variable of interest.

Additionally, the frequencies of the missing/imputed values can be represented by numbers. If so, the first line corresponds to the observed values of the variable of interest and their distribution in the different groups, the second line to the missing/imputed values.

If interactive=TRUE, clicking in the left margin of the plot results in switching to the previous variable and clicking in the right margin results in switching to the next variable. Clicking anywhere else on the graphics device quits the interactive session.

TKRpbox behaves like pbox with selection="none", but uses tkrplot to embed the plot in a Tcl/Tk window. This is useful for drawing a large number of parallel boxes, because scrollbars allow to move from one part of the plot to another.

References

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

See Also

parcoordMiss

Examples

Run this code

data(chorizonDL, package = "VIM")
## for missing values
pbox(log(chorizonDL[, c(4,5,8,10,11,16:17,19,25,29,37,38,40)]))

## for imputed values
pbox(kNN(log(chorizonDL[, c(4,8,10,11,17,19,25,29,37,38,40)])),
     delimiter = "_imp")

Run the code above in your browser using DataLab