This question refers to "Programming with dplyr"
I want to slice the ... argument of a function and use each element as an argument for a corresponding function.
foo <- function(...){
<some code>
}
should evaluate for example foo(x, y, z)
in this form:
list(bar(~x), bar(~y), bar(~z))
so that x, y, z
remain quoted till they get evaluated in bar
.
I tried this:
foo <- function(...){
arguments <- quos(...)
out <- map(arguments, ~bar(UQ(.)))
out
}
I have two intentions:
- Learn better how tidyeval/rlang works and when to use it.
- turn
future::futureOf()
into a function that get me more then one futures at once.
This approach might be overly complicated, because I don't fully understand the underlying concepts of tidyeval yet.
You don't really need any packages for this.
match.call
can be used.giving:
Another test
giving: