Description Usage Arguments Value Author(s) References See Also Examples
Captures an arbitrary R expression before it is actually evaluated. This might be useful in situations, where you want to delay the evaluation of the expression.
1 | captureExpression(expr, caller_offset = 1, brackets = TRUE)
|
expr |
Signature argument. Expression to capture. |
caller_offset |
|
brackets |
|
... |
Further arguments to be passed to subsequent functions/methods. |
curly brackets call
(can't write out the actual code
in roxygen) if brackets = TRUE
, else class of evaluated
expression.
Janko Thyson janko.thyson@rappster.de
http://github.com/Rappster/yamlr
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ## Not run:
## Expression wrapped in curly brackets //
res <- captureExpression({
"object-ref: {id: x_1}"
x_2 * 2
})
res
class(res)
inherits(res, "call")
## Expression w/o curly brackets //
res <- captureExpression(x_2 * 2)
res
class(res)
res <- captureExpression(x_2 * 2, brackets = FALSE)
res
class(res)
## Character //
res <- captureExpression("object-ref: {id: x_1}")
res
class(res)
res <- captureExpression("object-ref: {id: x_1}", brackets = FALSE)
res
class(res)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.