title: Cumulative sums for the previous row
body: <p>I'm trying to get cumulative sums for the previous row/year. Running <code>cumsum(data$fonds)</code> gives me the running totals of adjacent sells, which doesn't work for what I want to do. I would like to have my data look like the following:</p>
  
  <pre><code>   year      fond   cumsum  
  1  1950       0       0  
  2  1951       1       0
  3  1952       3       1
  4  1953       0       4
  5  1954       0       4
  </code></pre>
  
  <p>Any help would be appreciated.</p>