These options will be used on formulas, defined as calls to ~
, regardless
of their "class"
attribute.
Usage
opts_formula(
constructor = c("default", "formula", "as.formula", "new_formula", "next"),
...,
environment = TRUE
)
Arguments
- constructor
String. Name of the function used to construct the object, see Details section.
- ...
Additional options used by user defined constructors through the
opts
object- environment
Boolean. Whether to attempt to construct the environment, if it makes a difference to construct it.
Depending on
constructor
, we construct the formula as follows:"default"
: We construct the formula in the most common way using the~
operator."formula"
: deparse the formula as a string and usebase::formula()
on top of it."as.formula"
: Same as above, but usingbase::as.formula()
."new_formula"
: extract both sides of the formula as separate language objects and feed them torlang::new_formula()
, along with the reconstructed environment if relevant.