remove_zerovar: Remove predictors with near-zero variance

Description Usage Arguments Details Value

View source: R/remove_zerovar.R

Description

remove_zerovar is a wrapper for caret::nearZeroVar and indexing the data frame to remove the resulting predictors.

Usage

1
remove_zerovar(df, ignore_col = NA, quiet = T, ...)

Arguments

df

The data frame to be processed.

ignore_col

Columns that will not be preprocessed, given as a character vector. This will likely constitute the response variable. The default is ignore_col = NA. These columns will be reappended to the data frame at the beginning.

quiet

Whether to suppress the message for how many predictors are removed in preprocessing. The default is quiet = T.

...

Additional arguments to be passed to caret::nearZeroVar

Details

Because the data frame to be passed to the function will likely include columns that do not need to be transformed (like columns for identification) or response variables, there is an option to ignore these columns using ignore_col. The input to ignore_col should be a character vector.

Value

A data frame with columns centered and scaled and with variables with near-zero variance removed. Columns can be ignored and not be preprocessed.


awqx/qsarr documentation built on Oct. 2, 2021, 7:05 a.m.