cumsum() returns a vector of cumulative sums from another numeric vector. For 1, 2, and 3, it returns 1, 3, and 6. section 6.4.1
Build cumulative NBA totals
After counting first-quarter outcome categories and sorting them by frequency, add cumulative counts with mutate(cum_n = cumsum(n)). The resulting values are 783, 1333, 1698, and 1990; cumsum(pct_total) similarly produces cumulative percentages ending at 100.00. section 6.4.1
