View source: R/validate_arg_df.R
| validate_arg_df | R Documentation |
dfInternal function to validate the integrity of the argument df. It ensures that the dataframe has suitable dimensions for a multicollinearity analysis, transforms logical columns to numeric, character columns to factors, and converts NaN, Inf and -Inf to NA. Additionally, it checks the values of responses and predictors if these arguments are provided.
validate_arg_df(
df = NULL,
responses = NULL,
predictors = NULL,
quiet = FALSE,
function_name = NULL
)
df |
(required; dataframe, tibble, or sf) A dataframe with responses
(optional) and predictors. Must have at least 10 rows for pairwise
correlation analysis, and |
responses |
(optional; character, character vector, or NULL) Name of
one or several response variables in |
predictors |
(optional; character vector or NULL) Names of the
predictors in |
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 |
dataframe
Other argument_validation:
drop_geometry_column(),
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(),
validate_arg_responses()
data(vi_smol, vi_predictors)
df <- validate_arg_df(
df = vi_smol,
responses = "vi_numeric",
predictors = vi_predictors_numeric,
quiet = FALSE
)
attributes(vi)$validated
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.