Quantcast
Channel: How to avoid ellipsis ... in dplyr? - Stack Overflow
Browsing all 4 articles
Browse latest View live

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 Article


Answer 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 Article


Answer 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 Article

How 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
Browsing all 4 articles
Browse latest View live


Latest Images