title: Cumulative sums, moving averages, and SQL "group by" equivalents in R
body: <p>What's the most efficient way to create a moving average or rolling sum in R? How do you do the rolling function along with a "group by"?</p>