Returns a list with the names of the valid numeric, categorical, and logical variables in a modelling dataframe.
identify_valid_variables(
df = NULL,
responses = NULL,
predictors = NULL,
decimals = 4,
quiet = FALSE,
...
)list
numeric: character vector of numeric predictors.
categorical: character vector of categorical (character and factor) predictors.
logical: character vector of logical predictors.
(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.
(optional; character, character vector, or NULL) Name of
one or several response variables in df. Default: NULL.
(required, character vector) Names of the predictors to identify. Default: NULL
(required, integer) Number of decimal places for the zero variance test. Smaller numbers will increase the number of variables detected as near-zero variance. Recommended values will depend on the range of the numeric variables in 'df'. Default: 4
(optional; logical) If FALSE, messages are printed. Default: FALSE.
(optional) Internal args (e.g. function_name for
validate_arg_function_name, a precomputed correlation matrix
m, or cross-validation args for preference_order).
Blas M. Benito, PhD
Other data_types:
identify_categorical_variables(),
identify_logical_variables(),
identify_numeric_variables(),
identify_response_type(),
identify_zero_variance_variables()
data(vi_smol, vi_predictors)
x <- identify_valid_variables(
df = vi_smol,
predictors = vi_predictors
)
x
Run the code above in your browser using DataLab