missingness_indicators: Return matrix of missingness indicators for a dataframe or...

Description Usage Arguments Value See Also Examples

View source: R/missingness_indicators.R

Description

Return matrix of missingness indicators for a dataframe or matrix. Removes constant or collinear indicators.

Usage

1
2
missingness_indicators(data, prefix = "miss_", remove_constant = T,
  remove_collinear = T, skip_vars = c(), verbose = F)

Arguments

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.

Value

Matrix of missingness indicators

See Also

impute_missing_values

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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)

ck37r documentation built on June 4, 2017, 1:02 a.m.