View source: R/formula_utils.R
| formula_setdiff | R Documentation |
Returns a formula containing the terms in formula_x that are not
present in formula_y.
formula_setdiff(formula_x, formula_y, env = parent.frame())
formula_x |
An R formula from which terms are selected. |
formula_y |
An R formula specifying terms to be excluded. |
env |
the environment for the output formula |
An R formula containing the terms present in formula_x
but not in formula_y.
Øyvind Langsrud
formula_x <- ~a * b + c
formula_y <- ~a + b
formula_setdiff(formula_x, formula_y)
# The intercept is handled separately
formula_setdiff(~a + b, ~a - 1)
formula_setdiff(~a + b - 1, ~a)
# Identical formulas
formula_setdiff(~a + b, ~a + b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.