validate_predictors {collinear}R Documentation

Validate Argument predictors

Description

Internal function to validate the predictors argument. Requires the argument 'df' to be validated with validate_df().

Validates the 'predictors' argument to ensure it complies with the requirements of the package functions. It performs the following actions:

Usage

validate_predictors(
  df = NULL,
  response = NULL,
  predictors = NULL,
  quiet = FALSE
)

Arguments

df

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

response

(optional; character string or vector) Name/s of response variable/s in df. Used in target encoding when it names a numeric variable and there are categorical predictors, and to compute preference order. 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

quiet

(optional; logical) If FALSE, messages generated during the execution of the function are printed to the console Default: FALSE

Value

character vector: predictor names

See Also

Other data_validation: validate_data_cor(), validate_data_vif(), validate_df(), validate_encoding_arguments(), validate_preference_order(), validate_response()

Examples


data(
  vi,
  vi_predictors
  )

#validating example data frame
vi <- validate_df(
  df = vi
)

#validating example predictors
vi_predictors <- validate_predictors(
  df = vi,
  predictors = vi_predictors
)

#tagged as validated
attributes(vi_predictors)$validated


[Package collinear version 2.0.0 Index]