title: Quarterly Year over Year Growth Rate
body: <p>I have been trying to calculate the growth rate comparing quarter 1 from one year to quarter 1 for the following year.<br>
  In excel the formula would look like this ((B6-B2)/B2)*100.</p>
  
  <p>What is the best way to accomplish this in R? I know how to get the differences from period to period, but cannot accomplish it with 4 time periods' difference.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>date &lt;- c("2000-01-01","2000-04-01", "2000-07-01",
            "2000-10-01","2001-01-01","2001-04-01",
            "2001-07-01","2001-10-01","2002-01-01",
            "2002-04-01","2002-07-01","2002-10-01")
  value &lt;- c(1592,1825,1769,1909,2022,2287,2169,2366,2001,2087,2099,2258)
  df &lt;- data.frame(date,value)
  </code></pre>
  
  <p>Which will produce this data frame:</p>
  
  <pre><code>    date       value
  1   2000-01-01  1592
  2   2000-04-01  1825
  3   2000-07-01  1769
  4   2000-10-01  1909
  5   2001-01-01  2022
  6   2001-04-01  2287
  7   2001-07-01  2169
  8   2001-10-01  2366
  9   2002-01-01  2001
  10  2002-04-01  2087
  11  2002-07-01  2099
  12  2002-10-01  2258
  </code></pre>