Description Usage Arguments Examples
View source: R/data_wrangling.R
this function shows how common possible missingness patterns are. Emulates misschk in stata.
excludes any variables that don't have any missings, so as not to clutter output. Disable using omit_complete
sorts variables by number of missings, so that the usual suspects show up at the front.
displays number of missings accounted for by each pattern
1 2 3 |
df |
dataset |
min_freq |
show only patterns that occur at least this often. Defaults to 1 observation. |
long_pattern |
by default (FALSE) only shows column indices for space and legibility reasons. |
print_legend |
prints a legend for the column indices, defaults to FALSE if long_pattern is set |
show_culprit |
defaults to TRUE. In case a missingness pattern boils down to one variable, it will be shown here. |
relative |
defaults to FALSE. If true, percentages are shown (relative to total before excluding minimum frequency). |
omit_complete |
defaults to TRUE. Columns that don't have any missings are excluded. |
1 2 3 4 5 | data(ChickWeight)
ChickWeight[1:2,c('weight','Chick')] = NA
ChickWeight[3:5,'Diet'] = NA
names(ChickWeight); nrow(ChickWeight)
missingness_patterns(ChickWeight)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.