f_capture: Make a promise explicit by converting into a formula.

Description Usage Arguments Value Examples

Description

This should be used sparingly if you want to implement true non-standard evaluation with 100% magic. I recommend avoiding this unless you have strong reasons otherwise since requiring arguments to be formulas only adds one extra character to the inputs, and otherwise makes life much much simpler.

Usage

1
2
3
f_capture(x)

dots_capture(..., .ignore_empty = TRUE)

Arguments

x, ...

An unevaluated promises

.ignore_empty

If TRUE, empty arguments will be silently dropped.

Value

f_capture returns a formula; dots_capture returns a list of formulas.

Examples

1
2
3
4
5
6
7
8
9
f_capture(a + b)
dots_capture(a + b, c + d, e + f)

# These functions will follow a chain of promises back to the
# original definition
f <- function(x) g(x)
g <- function(y) h(y)
h <- function(z) f_capture(z)
f(a + b + c)


Search within the lazyeval package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.