Calculate the cumulative sum of number & percentage of missingness for each variable.

miss_var_cumsum(data)

Arguments

data

a data.frame

Value

a tibble of the cumulative sum of missing data in each variable

See also

Examples

miss_var_cumsum(airquality)
#> # A tibble: 6 x 3 #> variable n_miss n_miss_cumsum #> <chr> <int> <int> #> 1 Ozone 37 37 #> 2 Solar.R 7 44 #> 3 Wind 0 44 #> 4 Temp 0 44 #> 5 Month 0 44 #> 6 Day 0 44
library(dplyr) # respects dplyr::group_by airquality %>% group_by(Month) %>% miss_var_cumsum()
#> # A tibble: 25 x 4 #> # Groups: Month [5] #> Month variable n_miss n_miss_cumsum #> <int> <chr> <int> <int> #> 1 5 Ozone 5 5 #> 2 5 Solar.R 4 9 #> 3 5 Wind 0 9 #> 4 5 Temp 0 9 #> 5 5 Day 0 9 #> 6 6 Ozone 21 21 #> 7 6 Solar.R 0 21 #> 8 6 Wind 0 21 #> 9 6 Temp 0 21 #> 10 6 Day 0 21 #> # … with 15 more rows