powered by
Add new variables that indicate if a value is "missing" or "not missing" for original variables that contain NA
expand_na( data, types = c("chr", "dbl", "fct", "lgl", "int", "ord"), skip_vars = NULL )
An augmented data frame with the original variables and new variables that contain the missingness patterns of variables with NA
A data frame
A vector of variables types to expand
A character vector of variables that shouldn't be expanded
expand_na(data = example_na, type = c("dbl", "int"))
Run the code above in your browser using DataLab