update.formula is used to update model formulae. This typically involves adding or dropping terms, but updates can be more general.
## S3 method for class 'formula': update((old, new, ...))
- a model formula to be updated.
- a formula giving a template which specifies how to update.
- further arguments passed to or from other methods.
The function works by first identifying the left-hand side and right-hand side of the
old formula. It then examines the
new formula and substitutes the lhs of the
old formula for any occurrence of ‘.’ on the left of
new, and substitutes the rhs of the
old formula for any occurrence of ‘.’ on the right of
new. The result is then simplified via
terms.formula(simplify = TRUE).
The updated formula is returned. The environment of the result is that of
Documentation reproduced from R 3.0.1. License: GPL-2.