bind_shadow | R Documentation |
Binding a shadow matrix to a regular dataframe helps visualise and work with missing data.
bind_shadow(data, only_miss = FALSE, ...)
data |
a dataframe |
only_miss |
logical - if FALSE (default) it will bind a dataframe with all of the variables duplicated with their shadow. Setting this to TRUE will bind variables only those variables that contain missing values. See the examples for more details. |
... |
extra options to pass to |
data with the added variable shifted and the suffix _NA
bind_shadow(airquality) # bind only the variables that contain missing values bind_shadow(airquality, only_miss = TRUE) aq_shadow <- bind_shadow(airquality) ## Not run: # explore missing data visually library(ggplot2) # using the bounded shadow to visualise Ozone according to whether Solar # Radiation is missing or not. ggplot(data = aq_shadow, aes(x = Ozone)) + geom_histogram() + facet_wrap(~Solar.R_NA, ncol = 1) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.