Description Usage Arguments Value Examples
Capture ... (dots) for later lazy evaluation.
1 |
... |
Dots from another function |
.follow_symbols |
If |
.ignore_empty |
If |
A named list of lazy
expressions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | lazy_dots(x = 1)
lazy_dots(a, b, c * 4)
f <- function(x = a + b, ...) {
lazy_dots(x = x, y = a + b, ...)
}
f(z = a + b)
f(z = a + b, .follow_symbols = TRUE)
# .follow_symbols is off by default because it causes problems
# with lazy loaded objects
lazy_dots(letters)
lazy_dots(letters, .follow_symbols = TRUE)
# You can also modify a dots like a list. Anything on the RHS will
# be coerced to a lazy.
l <- lazy_dots(x = 1)
l$y <- quote(f)
l[c("y", "x")]
l["z"] <- list(~g)
c(lazy_dots(x = 1), lazy_dots(f))
|
$x
<lazy>
expr: 1
env: <environment: R_GlobalEnv>
attr(,"class")
[1] "lazy_dots"
[[1]]
<lazy>
expr: a
env: <environment: R_GlobalEnv>
[[2]]
<lazy>
expr: b
env: <environment: R_GlobalEnv>
[[3]]
<lazy>
expr: c * 4
env: <environment: R_GlobalEnv>
attr(,"class")
[1] "lazy_dots"
$x
<lazy>
expr: x
env: <environment: 0x2793e88>
$y
<lazy>
expr: a + b
env: <environment: 0x2793e88>
$z
<lazy>
expr: a + b
env: <environment: R_GlobalEnv>
attr(,"class")
[1] "lazy_dots"
$x
<lazy>
expr: a + b
env: <environment: 0x27adbe0>
$y
<lazy>
expr: a + b
env: <environment: 0x27adbe0>
$z
<lazy>
expr: a + b
env: <environment: R_GlobalEnv>
attr(,"class")
[1] "lazy_dots"
[[1]]
<lazy>
expr: letters
env: <environment: R_GlobalEnv>
attr(,"class")
[1] "lazy_dots"
[[1]]
<lazy>
expr: letters
env: <environment: R_GlobalEnv>
attr(,"class")
[1] "lazy_dots"
$y
<lazy>
expr: f
env: <environment: R_GlobalEnv>
$x
<lazy>
expr: 1
env: <environment: R_GlobalEnv>
attr(,"class")
[1] "lazy_dots"
$x
<lazy>
expr: 1
env: <environment: R_GlobalEnv>
[[2]]
<lazy>
expr: f
env: <environment: R_GlobalEnv>
attr(,"class")
[1] "lazy_dots"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.