Description Usage Arguments Examples
tags inspired by dplyr functions to modify the dots of the call
1 2 3 4 5 6 7 8 9 | selecting_dots(...vars)
renaming_dots(...vars)
mutating_dots(...exprs)
transmuting_dots(...exprs)
reversing_dots()
|
...vars |
A list of columns generated by vars() |
...exprs |
A list of expressions generated by exprs() |
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 | ## Not run:
library(dplyr)
library(purrr)
library(rlang)
# the functions can be used in regular calls
reversing_dots$paste0("a", "b")
selecting_dots(vars(b2,starts_with("a")))$
transform(head(cars,2), a1 = 1, b1 = 2, a2 = 3, b2 = speed *100)
mutating_dots(exprs(foo = 1000 * bar))$
mutate(head(cars,2), bar = speed * 10)
# or with forwarded dots
fun <- function(...){
print(
selecting_dots(vars(b2,starts_with("a")))$
mutate(head(cars,2), ...))
print(
renaming_dots(vars(foo = a1))$
mutate(head(cars,2), ...))
print(
mutating_dots(exprs(a2 = 100*a2 + a1, foo = 1000 * b1))$
mutate(head(cars,2), ...))
print(
transmuting_dots(exprs(a2 = 100*a2 + a1, foo = 1000 * b1))$
mutate(head(cars,2), ...))
print(
reversing_dots$mutate(head(cars,2), ...))
}
fun(a1 = 1, b1 = 2, a2 = 3, b2 = 40)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.