validate_df | R Documentation |
Internal function to validate the argument df
and ensure it complies with the requirements of the package functions. It performs the following actions:
Stops if 'df' is NULL.
Stops if 'df' cannot be coerced to data frame.
Stops if 'df' has zero rows.
Removes geometry column if the input data frame is an "sf" object.
Removes non-numeric columns with as many unique values as rows df has.
Converts logical columns to numeric.
Converts factor and ordered columns to character.
Tags the data frame with the attribute validated = TRUE
to let the package functions skip the data validation.
validate_df(df = NULL, quiet = FALSE)
df |
(required; data frame, tibble, or sf) A data frame with responses and predictors. Default: NULL. |
quiet |
(optional; logical) If FALSE, messages generated during the execution of the function are printed to the console Default: FALSE |
data frame
Other data_validation:
validate_data_cor()
,
validate_data_vif()
,
validate_encoding_arguments()
,
validate_predictors()
,
validate_preference_order()
,
validate_response()
data(vi)
#validating example data frame
vi <- validate_df(
df = vi
)
#tagged as validated
attributes(vi)$validated
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.