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

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -