Provide a tidy table of the number of variables with 0, 1, 2, up to n, missing values and the proportion of the number of variables those variables make up.

miss_var_table(data)

Arguments

data

a dataframe

Value

a dataframe

See also

Examples

miss_var_table(airquality)
#> # A tibble: 3 x 3 #> n_miss_in_var n_vars pct_vars #> <int> <int> <dbl> #> 1 0 4 66.7 #> 2 7 1 16.7 #> 3 37 1 16.7
library(dplyr) airquality %>% group_by(Month) %>% miss_var_table()
#> # A tibble: 12 x 4 #> Month n_miss_in_var n_vars pct_vars #> <int> <int> <int> <dbl> #> 1 5 0 3 60 #> 2 5 4 1 20 #> 3 5 5 1 20 #> 4 6 0 4 80 #> 5 6 21 1 20 #> 6 7 0 4 80 #> 7 7 5 1 20 #> 8 8 0 3 60 #> 9 8 3 1 20 #> 10 8 5 1 20 #> 11 9 0 4 80 #> 12 9 1 1 20