Learn R Programming

collinear (version 2.0.0)

validate_response: Validate Argument response

Description

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

Usage

validate_response(df = NULL, response = NULL, quiet = FALSE)

Value

character string: response name

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.

quiet

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

See Also

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

Examples

Run this code

data(
  vi
)

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

#validating example predictors
response <- validate_response(
  df = vi,
  response = "vi_numeric"
)

#tagged as validated
attributes(response)$validated

Run the code above in your browser using DataLab