Internal function to validate the argument response
. Requires the argument 'df' to be validated with validate_df()
.
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
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
#> [1] TRUE