title: Computing the year-on-year growth rate of a quarterly time series
body: <p>I am discovering R and, although I see how powerful it can be, I am also a bit lost.
  In that case, I have a quarterly times series, called Inflation.
  My goal is to compute the yoy growth rate for each quarterly data point. 
  So basically, as it starts in Q1 1981, I want to do (Inflation Q1 1982 - Inflation Q1 1981)/Inflation Q1 1981 for the 1st point, and so on and so forth...</p>
  
  <p>When I do a diff(Inflation,lag=4) I get the first part, that is (Inflation Q1 1982 - Inflation Q1 1981).
  But how do I tell R to divide that by Inflation Q1 1981 for the 1st point, then by Inflation Q2 1981...</p>
  
  <p>Coming from other languages, my first approach would be a loop but I am sure R can do that more quickly and more efficiently.</p>
  
  <p>Thanks!</p>