I used to do it, using group_by_
library(dplyr)
group_by <- c('cyl', 'vs')
mtcars %>% group_by_(.dots = group_by) %>% summarise(gear = mean(gear))
but now group_by_
is deprecated. I don't know how to do it using the tidy evaluation framework.
I used to do it, using group_by_
library(dplyr)
group_by <- c('cyl', 'vs')
mtcars %>% group_by_(.dots = group_by) %>% summarise(gear = mean(gear))
but now group_by_
is deprecated. I don't know how to do it using the tidy evaluation framework.
Transform the character vector into a list of symbols and splice it in
There is
group_by_at
variant ofgroup_by
:Above it's simplified version of generalized:
inside
vars
you could use anydplyr
way of select variables: