Return for each case the number and percent of missing values, ordered by the most number of missings.

miss_case_summary(data, order = FALSE, ...)

Arguments

data

a data.frame

order

a logical indicating whether or not to order the result by n_miss. TRUE orders from largest to smallest n_miss, and FALSE orders by order provided by the data.

...

extra arguments

Value

a tibble of the percent of missing data in each case.

See also

Examples

# works with group_by from dplyr library(dplyr) airquality %>% group_by(Month) %>% miss_case_summary()
#> # A tibble: 153 x 5 #> Month case n_miss pct_miss n_miss_cumsum #> <int> <int> <int> <dbl> <int> #> 1 5 1 0 0 0 #> 2 5 2 0 0 0 #> 3 5 3 0 0 0 #> 4 5 4 0 0 0 #> 5 5 5 2 40 2 #> 6 5 6 1 20 3 #> 7 5 7 0 0 3 #> 8 5 8 0 0 3 #> 9 5 9 0 0 3 #> 10 5 10 1 20 4 #> # ... with 143 more rows
miss_case_summary(airquality)
#> # A tibble: 153 x 4 #> case n_miss pct_miss n_miss_cumsum #> <int> <int> <dbl> <int> #> 1 1 0 0 0 #> 2 2 0 0 0 #> 3 3 0 0 0 #> 4 4 0 0 0 #> 5 5 2 33.3 2 #> 6 6 1 16.7 3 #> 7 7 0 0 3 #> 8 8 0 0 3 #> 9 9 0 0 3 #> 10 10 1 16.7 4 #> # ... with 143 more rows