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.
Usage
validate_df(df = NULL, quiet = FALSE)
Value
data frame
Arguments
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
See Also
Other data_validation:
validate_data_cor(),
validate_data_vif(),
validate_encoding_arguments(),
validate_predictors(),
validate_preference_order(),
validate_response()