View source: R/export-MissingData.R
plot_missing_data | R Documentation |
Creates a tile plot highlighting combinations of grouping variables that are expected but missing from the data. Allows for faceting.
plot_missing_data(
data,
x,
y,
stratify_by = NULL,
for_each = NULL,
facet_labeller = NULL,
title = "Missing data",
subtitle = NULL,
x_lab = NULL,
y_lab = NULL
)
data |
Data frame. |
x |
Variable in |
y |
Variable in |
stratify_by |
(Optional) Stratification variable. If
supplied, missing data is examined separately for each leves of |
for_each |
(Optional) Additional stratification variable. If supplied,
separate plot windows are created per level of |
facet_labeller |
A |
title |
Character string for the plot title. Defaults to "Missing data". |
subtitle |
Character string for the plot subtitle. Defaults to NULL. |
x_lab |
Character string for the x-axis label. Defaults to the name of |
y_lab |
Character string for the y-axis label. Defaults to the name of |
A ggplot object, or NULL if no missing combinations found.
ggplot
data("toy_data")
# Plot missing data across age and period, stratified by education, for each sex
plot_missing_data (data = toy_data,
x = period,
y = age,
stratify_by = education,
for_each = sex)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.