Group by multiple columns in R's dplyr -
i group data frame multiple columns names elements of vector names_vec
:
df %>% group_by(names_vec)
i error message: "column names_vec unknown". because there no 1 column called names_vec
.
how achieve this?
use rlang::syms()
coupled !!!
:
library(rlang) df %>% group_by(!!!syms(names_vec))
Comments
Post a Comment