validate_arg_predictors: Check and validate argument 'predictors'

View source: R/validate_arg_predictors.R

validate_arg_predictorsR Documentation

Check and validate argument predictors

Description

Validates the argument predictors by ensuring that all provided predictors are in df and don't intersect with responses, if any.

Usage

validate_arg_predictors(
  df = NULL,
  responses = NULL,
  predictors = NULL,
  quiet = FALSE,
  function_name = NULL
)

Arguments

df

(required; dataframe, tibble, or sf) A dataframe with responses (optional) and predictors. Must have at least 10 rows for pairwise correlation analysis, and 10 * (length(predictors) - 1) for VIF. Default: NULL.

responses

(optional; character, character vector, or NULL) Name of one or several response variables in df. Default: NULL.

predictors

(optional; character vector or NULL) Names of the predictors in df. If NULL, all columns except responses and constant/near-zero-variance columns are used. Default: NULL.

quiet

(optional; logical) If FALSE, messages are printed. Default: FALSE.

function_name

(optional, character string) Name of the function performing the argument check. Default: NULL

Value

character vector: predictor names

See Also

Other argument_validation: drop_geometry_column(), validate_arg_df(), validate_arg_df_not_null(), validate_arg_encoding_method(), validate_arg_f(), validate_arg_function_name(), validate_arg_max_cor(), validate_arg_max_vif(), validate_arg_preference_order(), validate_arg_quiet(), validate_arg_responses()

Examples

data(vi_smol, vi_predictors)

x <- validate_arg_predictors(
  df = vi_smol,
  predictors = vi_predictors
)

attributes(x)$validated


collinear documentation built on Dec. 8, 2025, 5:06 p.m.