loading...

The formula-masking is a little bit like the data-masking used in dplyr, except it uses formulas for non-standard evaluation of the arguments, otherwise, it uses standard evaluation. It allows to use both approaches (standard and non-standard) within the same function. Moreover, the intention of the user and the possible non-standard evaluation of the arguments are clearer through formulas.

formula_masking(
  ...,
  .max.args = NULL,
  .must.be.named = FALSE,
  .make.names = FALSE,
  .no.se = FALSE,
  .no.se.msg = gettext("Standard evaluation is not allowed."),
  .envir = parent.frame(2L),
  .frame = parent.frame(),
  .verbose = .op$verbose
)

Arguments

...

Arguments to be processed by formula-masking.

.max.args

The maximum allowed arguments in ....

.must.be.named

If TRUE, all arguments must be named.

.make.names

If TRUE, unnamed arguments are named automatically.

.no.se

If TRUE, standard evaluation is not allowed.

.no.se.msg

The message to be used if standard evaluation is not allowed.

.envir

The environment where to expand formulas (possibly superseded by the environment attached to the first formula).

.frame

The frame where the focus in the calling stack should be set in error messages (not used yet).

.verbose

If TRUE, some additional information about formulas substitution is printed.

Value

A list with components:

  • dots: A list of arguments, either expressions (if standard evaluation was used) or expressions extracted from the right-hand side of the formulas (if formulas were used).

  • env: The environment where the expressions should be evaluated.

  • are_formulas: TRUE if formulas were used, FALSE if standard evaluation was used.

Examples

# TODO...