title: calculate return on columns for multiple groups
body: <p>I have a data frame</p>
  
  <pre><code> data.frame(quarter= c(1,2,3), group1 = c(1,2,3), group2 = c(6,8,10))
  </code></pre>
  
  <p>what's the best way to produce the return by quarter so the results are</p>
  
  <pre><code>quarter  group1  group 2
  2         1.0     .333
  3          .5        .25
  </code></pre>
  
  <p>where the return calculation is (Current value - PRevious) /previous so for quarter 3 group 1 (3-2)/2 =.5</p>