R - aggregating sum row wise : <p>I have a data frame mydf as <code> mydf &lt;- data.frame(month = c('apr', 'may', 'june'),cost = c(100, 150, 200))</code></p>

<p>I wish to get a runningTotal that sums each record cumulatively</p>

<pre><code>  month cost runningTotal
1   apr  100          100
2   may  150          250
3  june  200          450
</code></pre>

<p>I tried using dplyr sum but didn't work.
Can someone help me find the most efficient way of doing this
Thanks.</p>
