# NOT RUN {
# Group a data frame by all variables:
group_by_all(mtcars)
# Group by variables selected with a predicate:
group_by_if(iris, is.factor)
# Group by variables selected by name:
group_by_at(mtcars, vars(vs, am))
# Like group_by(), the scoped variants have optional mutate
# semantics. This provide a shortcut for group_by() + mutate():
group_by_all(mtcars, as.factor)
group_by_if(iris, is.factor, as.character)
# }
Run the code above in your browser using DataLab