Learn R Programming

collinear (version 1.1.1)

identify_numeric_predictors: Identify numeric predictors

Description

Given 'df' and 'predictors' arguments, this function subsets and returns the numeric predictors.

Usage

identify_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
if (interactive()) {

data(
  vi,
  vi_predictors
)

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

numeric.predictors

}

Run the code above in your browser using DataLab