Generates a visual summary of missing data for variables in a REDCap dataset or list structure. For cross-sectional (single-event) studies, it displays a barplot showing the proportion or count of missing values per variable. For longitudinal (multi-event) studies, it generates a heatmap illustrating missingness across events and variables.
Usage
rd_missplot(
data,
sort_by_missingness = TRUE,
max_vars = NULL,
show_percentages = TRUE,
use_field_labels = TRUE,
drop_complete = TRUE
)Arguments
- data
A
data frameor a list containing adataelement retrieved from REDCap.- sort_by_missingness
Logical. Variables are ordered from highest to lowest missingness. Default
TRUE.- max_vars
Integer. If specified, only the top
max_varsvariables are plotted (by missingness, or by original column order ifsort_by_missingness = FALSE). DefaultNULL(show all variables).- show_percentages
Logical. Displays missingness as percentages. Default
TRUE.- use_field_labels
Logical. Uses field labels from the dictionary for axis labels instead of variable names. Default
TRUE.- drop_complete
Logical. Variables with 0 missing values are excluded from the plot. Default
TRUE.
