Description Usage Arguments Value See Also Examples
View source: R/missingness_indicators.R
Return matrix of missingness indicators for a dataframe or matrix. Removes constant or collinear indicators.
1 2 3 4 5 6 7 8 |
data |
Dataframe or matrix to analyze for missingness. |
prefix |
Name prefix for new indicator columns. |
remove_constant |
Remove any indicators that are all 0 or all 1. |
remove_collinear |
Remove any indicators that are collinear with each other. |
skip_vars |
Vector of variable names to skip. |
verbose |
If TRUE, print additional information. |
Matrix of missingness indicators
1 2 3 4 5 6 7 8 9 10 11 12 | # Load a test dataset.
data(PimaIndiansDiabetes2, package = "mlbench")
# Check for missing values.
colSums(is.na(PimaIndiansDiabetes2))
# Generate missingness indicators; skip outcome variable.
indicators = missingness_indicators(PimaIndiansDiabetes2,
skip_vars = "diabetes")
# Check missingness.
colSums(indicators)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.