f_rhs
extracts the righthand side, f_lhs
extracts the lefthand
side, and f_env
extracts the environment. All functions throw an
error if f
is not a formula.
f_rhs(f) f_rhs(x) <- value f_lhs(f) f_lhs(x) <- value f_env(f) f_env(x) <- value
f, x | A formula |
---|---|
value | The value to replace with. |
f_rhs
and f_lhs
return language objects (i.e. atomic
vectors of length 1, a name, or a call). f_env
returns an
environment.
f_rhs(~ 1 + 2 + 3)#> 1 + 2 + 3f_rhs(~ x)#> xf_rhs(~ "A")#> [1] "A"f_rhs(1 ~ 2)#> [1] 2f_lhs(~ y)#> NULLf_lhs(x ~ y)#> xf_env(~ x)#> <environment: 0x7460250>