substitute_formula_vars {SSBtools} | R Documentation |
Replace variables in formula with sum of other variables
Description
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 |
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. |
Value
model formula
Author(s)
Daniel Lupp and Øyvind Langsrud
Examples
f <- ~b + a*c + b:d
substitute_formula_vars(f, list(a = c("hello", "world", "b"),
b = c("Q1", "Q2")))
[Package SSBtools version 1.8.0 Index]