File: lazy_dots.Rd

package info (click to toggle)
r-cran-lazyeval 0.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 596 kB
  • sloc: ansic: 310; sh: 9; makefile: 2
file content (46 lines) | stat: -rw-r--r-- 1,169 bytes parent folder | download | duplicates (2)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lazy-dots.R
\name{lazy_dots}
\alias{lazy_dots}
\title{Capture ... (dots) for later lazy evaluation.}
\usage{
lazy_dots(..., .follow_symbols = FALSE, .ignore_empty = FALSE)
}
\arguments{
\item{...}{Dots from another function}

\item{.follow_symbols}{If \code{TRUE}, the default, follows promises across
function calls. See \code{vignette("chained-promises")} for details.}

\item{.ignore_empty}{If \code{TRUE}, empty arguments will be ignored.}
}
\value{
A named list of \code{\link{lazy}} expressions.
}
\description{
Capture ... (dots) for later lazy evaluation.
}
\examples{
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))
}