plot_flux | R Documentation |
Plot the influx and outflux of a multivariate missing data pattern
plot_flux(data, vrb = "all", label = TRUE, caption = TRUE)
data |
An incomplete dataset of class |
vrb |
String, vector, or unquoted expression with variable name(s), default is "all". |
label |
Logical indicating whether variable names should be displayed within the plot (the default) or with colors in the legend. |
caption |
Logical indicating whether the figure caption should be displayed. |
An object of class ggplot2::ggplot.
# plot flux for all columns
plot_flux(mice::nhanes)
# plot flux for specific columns by supplying a character vector
plot_flux(mice::nhanes, c("chl", "hyp"))
# plot flux for specific columns by supplying unquoted variable names
plot_flux(mice::nhanes, c(chl, hyp))
# plot flux for specific columns by passing an object with variable names
# from the environment, unquoted with `!!`
my_variables <- c("chl", "hyp")
plot_flux(mice::nhanes, !!my_variables)
# object with variable names must be unquoted with `!!`
try(plot_flux(mice::nhanes, my_variables))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.