group_cols {dplyr} | R Documentation |
This selection helpers matches grouping variables. It can be used
in select()
or vars() selections.
group_cols(vars = peek_vars())
vars |
A character vector of variable names. When called
from inside selecting functions like |
groups()
and group_vars()
for retrieving the grouping
variables outside selection contexts.
gdf <- iris %>% group_by(Species) # Select the grouping variables: gdf %>% select(group_cols()) # Remove the grouping variables from mutate selections: gdf %>% mutate_at(vars(-group_cols()), `/`, 100)