Replace variables in formula with sum of other variables
Source:R/formula_utils.R
substitute_formula_vars.Rd
Replace variables in formula with sum of other variables
Usage
substitute_formula_vars(
f,
replacements,
simplify = FALSE,
env = parent.frame()
)
Arguments
- f
A model formula.
- replacements
A named list. The names of
replacements
must correspond to variables inf
. Each element inreplacements
must be a character vector consisting of the variables you wish to replace.- simplify
Logical, default is FALSE. Determines whether the formula should be expanded and simplified before output or not.
- env
The environment for the output formula.