This selection helper matches grouping variables. It can be used within select()
and relocate()
selections.
group_cols()
groups()
and group_vars()
for retrieving the grouping variables outside selection contexts.
# NOT RUN {
mtcars %>% group_by(am, cyl) %>% select(group_cols())
# }
Run the code above in your browser using DataLab