qmval: Draw a missing value plot

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/qmval.R

Description

A missing value plot shows the counts or proportions of missing values in each variable. It is essentially a stacked bar plot, i.e. a bar plot of variables split by the logical vectors of missingness of observations.

Usage

1
qmval(vars, data, horizontal = TRUE, standardize = TRUE, ...)

Arguments

vars

variables to show in the plot: a character vector of variable names, or a numeric vector of column indices, or a two-sided formula like ~ x1 + x2 + x3 (without the left-hand side); see var_names

...

arguments passed to qbar

data

a mutaframe created by qdata

horizontal

TRUE to draw a horizontal plot or FALSE (vertical)

standardize

logical: whether to standardize the height of each bar to 1

Details

As usual, common interactions are defined in common_key_press. Brushing on a missing value plot has a slightly different meaning with brushing other types of plots: if a rectangle is brushed in a missing value plot, all rows in the orginal data in which the current variable is brushed (i.e. either missing or non-missing) are brushed; on the other hand, the brushed rows in the original data will also be reflected in the missing value plot.

This plot is built upon the bar plot qbar.

Value

A missing value plot

Author(s)

Heike Hofmann and Yihui Xie

See Also

Other plots: qbar; qboxplot; qdensity; qhist, qspine; qparallel; qtime

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
library(cranvas)

## BRFSS data
qbrfss <- qdata(brfss)
qmval(names(brfss)[40:50], data = qbrfss)
qmval(51:68, data = qbrfss)
qmval(~poorhlth + fruit + greensal, data = qbrfss)

qparallel(100:110, data = qbrfss)

## TAO data
data(tao, package = "tourr")

qtao <- qdata(tao)
qmval(~., data = qtao)
qmval(~., data = qtao, horizontal = FALSE, standardize = FALSE, 
    main = "horizontal plot with counts")
qscatter(longitude, latitude, data = qtao)

cranvas_off()

ggobi/cranvas documentation built on May 17, 2019, 3:10 a.m.