Answer by Bruno for How to avoid ellipsis ... in dplyr?
You guys are over complicating things, this works just fine:library(tidyverse)wanted <- function(data, groups){ data %>% count(!!!groups)}mtcars %>% wanted(groups = vars(mpg,disp,hp))# A...
View ArticleAnswer by AndS. for How to avoid ellipsis ... in dplyr?
Here is another option to avoid quotations in the function call. I admit its not very pretty though.library(tidyverse)wanted <- function(data, groups){ grouping <- gsub(x =...
View ArticleAnswer by Benjamin Schwetz for How to avoid ellipsis ... in dplyr?
The triple bang operator and parse_quos from the rlang package will do the trick. For more info, see e.g. https://stackoverflow.com/a/49941635/6086135library(dplyr)library(magrittr)iris$group2 <-...
View ArticleHow to avoid ellipsis ... in dplyr?
I want to create a function that takes a grouping argument. Which can be a single or multiple variables. I want it to look like this:wanted <- function(data, groups, other_params){ data %>%...
View Article