sales |>summarize(biggest =largest(revenue), average =average(cost))
biggest
average
500
68
sales >> summarize(biggest = largest(col.revenue), average = average(col.cost))
biggest
average
500
68.0
Grouping is an argument rather than a step, so there is nothing to ungroup afterwards and no state to carry between verbs.
6.1 The nine ways to collapse a group
total and average are the two you will reach for most. There are nine altogether, and the list is closed.
total, average and median are the three that combine numbers into one. smallest and largest take the ends. first and last take a value by position, which is why they need the rows to be in a known order. row_count counts the rows and takes no column at all. unique_count counts how many different values a column holds.
first and last answer by position, so a sort in front of them is what decides which row they mean. Without one they still answer, and the answer is whatever order the rows arrived in.