Skip to contents

Returns the names of valid numeric predictors. Ignores predictors with constant values or with near-zero variance.

Usage

identify_predictors_numeric(df = NULL, predictors = NULL, decimals = 4)

Arguments

df

(required; data frame, tibble, or sf) A data frame with responses and predictors. Default: NULL.

predictors

(optional; character vector) Names of the predictors to select from df. If omitted, all numeric columns in df are used instead. If argument response is not provided, non-numeric variables are ignored. Default: NULL

decimals

(required, integer) Number of decimal places for the zero variance test. Smaller numbers will increase the number of variables detected as near-zero variance. Recommended values will depend on the range of the numeric variables in 'df'. Default: 4

Value

character vector: names of numeric predictors

Author

Blas M. Benito, PhD

Examples

if (interactive()) {

data(
  vi,
  vi_predictors
)

numeric.predictors <- identify_predictors_numeric(
  df = vi,
  predictors = vi_predictors
)

numeric.predictors

}