ggmissing {ggplot2} | R Documentation |
Create a plot to illustrate patterns of missing values
ggmissing(data, avoid="stack", order=TRUE, missing.only = TRUE)
data |
data.frame |
avoid |
whether missings should be stacked or dodged, see geom_bar for more details |
order |
whether variable should be ordered by number of missings |
missing.only |
whether only variables containing some missing values should be shown |
The missing values plot is a useful tool to get a rapid overview of the number of missings in a dataset. It's strength is much more apparent when used with interactive graphics, as you can see in Mondrian (http://rosuda.org/mondrian) where this plot was copied from.
Hadley Wickham <h.wickham@gmail.com>
mmissing <- movies mmissing[sample(nrow(movies), 1000), sample(ncol(movies), 5)] <- NA ggmissing(mmissing) ggmissing(mmissing, order=FALSE, missing.only = FALSE) ggmissing(mmissing, avoid="dodge") + scale_y_sqrt()