title: year-over-year percentage change in R
body: <p>though I have found several similar questions, I could not find a simple solution to my problem in base R.
  I want to calculate the yoy percentage change from a set of data (here the y value) and add this "Delta"-series as a new column to my data frame.</p>
  
  <p>For example:</p>
  
  <pre><code>&gt;x = c(2000,2001,2002,2003,2004,2005,2006)   
  &gt;y = c(100,104,106,108,112,115,121)   
  &gt;df = data.frame(x,y)
  </code></pre>
  
  <p>And what to do if I load my data by reading a .csv file? Do i have to convert this data to a data frame?</p>