leave_var_out_formulas {workflowsets} | R Documentation |
Create formulas without each predictor
Description
From an initial model formula, create a list of formulas that exclude each predictor.
Usage
leave_var_out_formulas(formula, data, full_model = TRUE, ...)
Arguments
formula |
A model formula that contains at least two predictors. |
data |
A data frame. |
full_model |
A logical; should the list include the original formula? |
... |
Options to pass to |
Details
The new formulas obey the hierarchy rule so that interactions without main effects are not included (unless the original formula contains such terms).
Factor predictors are left as-is (i.e., no indicator variables are created).
Value
A named list of formulas
See Also
Examples
data(penguins, package = "modeldata")
leave_var_out_formulas(
bill_length_mm ~ .,
data = penguins
)
leave_var_out_formulas(
bill_length_mm ~ (island + sex)^2 + flipper_length_mm,
data = penguins
)
leave_var_out_formulas(
bill_length_mm ~ (island + sex)^2 + flipper_length_mm +
I(flipper_length_mm^2),
data = penguins
)
[Package workflowsets version 1.1.0 Index]