A hack to speed up tapply(x, group, sum) for the special case where x is sorted by group.
A numeric vector.
A grouping factor.
Works by computing the cumulative sum of x and taking the difference
at the indices where the groups change. Standard
be slow when there are a large number of groups, due to the overhead
of factor manipulation.
Vector containing the group sums of
C. H. Jackson <email@example.com>
1 2 3 4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.