Learn R Programming

collinear (version 1.1.1)

identify_non_numeric_predictors: Identify non-numeric predictors

Description

Given 'df' and 'predictors' arguments, this function subsets and returns the non-numeric (character, factor, and logical) predictors.

Usage

identify_non_numeric_predictors(df = NULL, predictors = NULL)

Value

character vector with names of numeric predictors.

Arguments

df

(required; data frame) A data frame with numeric and/or character predictors predictors, and optionally, a response variable. Default: NULL.

predictors

(optional; character vector) A vector with predictor names in 'df'. If omitted, all columns of 'df' are used as predictors. Default:'NULL'

Author

Blas M. Benito

Examples

Run this code

data(
  vi,
  vi_predictors
)

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

non.numeric.predictors

Run the code above in your browser using DataLab