
Check and validate arguments response and responses
Source: R/validate_arg_responses.R
validate_arg_responses.RdInternal function validate the arguments response and responses. It checks that its value exists as a column name of df,
Usage
validate_arg_responses(
df = NULL,
responses = NULL,
max_responses = 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.- max_responses
(required, integer or NULL) Maximum number of responses to consider. 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
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_predictors(),
validate_arg_preference_order(),
validate_arg_quiet()
Examples
data(vi_smol)
x <- validate_arg_responses(
df = vi_smol,
responses = "vi_numeric"
)
attributes(x)$validated
#> [1] TRUE