View source: R/identify_logical_variables.R
| identify_logical_variables | R Documentation |
Identifies logical predictors and excludes those with constant values.
identify_logical_variables(
df = NULL,
responses = NULL,
predictors = NULL,
quiet = FALSE,
...
)
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 |
(required, character vector) Names of the predictors to identify. Default: NULL |
quiet |
(optional; logical) If FALSE, messages are printed. Default: FALSE. |
... |
(optional) Internal args (e.g. |
list:
valid: character vector with valid logical predictor names.
invalid: character vector with invalid logical predictor names.
Blas M. Benito, PhD
Other data_types:
identify_categorical_variables(),
identify_numeric_variables(),
identify_response_type(),
identify_valid_variables(),
identify_zero_variance_variables()
data(vi_smol, vi_predictors)
#invalid logical
vi_smol$logical_invalid <- TRUE
#valid logical
vi_smol$logical_valid <- sample(
x = c(TRUE, FALSE),
size = nrow(vi_smol),
replace = TRUE
)
x <- identify_logical_variables(
df = vi_smol,
predictors = c(
vi_predictors,
"logical_invalid",
"logical_valid"
)
)
x$valid
x$invalid
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.