I\'m writing functions that take in a data.frame and then do some operations. I need to add and subtract items from the group_by criteria in order to g
data.frame
group_by
Function to remove groups by column name
drop_groups_at <- function(df, vars){ df %>% group_by_at(setdiff(group_vars(.), vars)) } input %>% group_by(a, b) %>% drop_groups_at('b') %>% group_vars # [1] "a"