Many data analysis problems require working with particular combinations
of data. For example, finding the average sales for a given day of the
week could be achieved with group_by(day) and
summarise(sales = mean(sales). This would result in a data frame
with 7 rows (1 for each group) with the average sales stored in the
sales column.
Multiple grouping variables may be specified, separated by columns. The
above example could be extended to group by month as well as weekday,
e.g. group_by(month, day). The resulting data frame would then
have 12 blocks of 7 (84 rows) with an average for each week day in that
month provided the same way as above.