Jim calculates running totals in R:
Cumulative Sum calculation in R, using the dplyr package in R, you can calculate the cumulative sum of a column using the following methods.
Click through for examples of ungrouped and grouped operations. H/R R-Bloggers