validate_preference_order | R Documentation |
Internal function to validate the argument preference_order
.
validate_preference_order(
predictors = NULL,
preference_order = NULL,
preference_order_auto = NULL,
function_name = "collinear::validate_preference_order()",
quiet = FALSE
)
predictors |
(optional; character vector) Names of the predictors to select from |
preference_order |
(optional; string, character vector, output of
. Default: "auto" |
preference_order_auto |
(required, character vector) names of the predictors in the automated preference order returned by |
function_name |
(optional, character string) Name of the function performing the check. Default: "collinear::validate_preference_order()" |
quiet |
(optional; logical) If FALSE, messages generated during the execution of the function are printed to the console Default: FALSE |
character vector: ranked variable names
Other data_validation:
validate_data_cor()
,
validate_data_vif()
,
validate_df()
,
validate_encoding_arguments()
,
validate_predictors()
,
validate_response()
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
#validate preference order
my_order <- c(
"swi_max",
"swi_min",
"swi_deviance" #wrong one
)
my_order <- validate_preference_order(
predictors = vi_predictors,
preference_order = my_order,
preference_order_auto = vi_predictors
)
#has my_order first
#excludes wrong names
#all other variables ordered according to preference_order_auto
my_order
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.