title: Introduce a "value_t / value_t-1 -1" formula
body: <p>I have a .csv table with daily values of a stock and I want to add a column with daily returns. This means that I need to add a column that has this formula:</p>
  
  <pre><code>value_t / value_t-1 - 1
  </code></pre>
  
  <p>I currently have this:</p>
  
  <pre><code>temp &lt;- read.table("data.csv",header=TRUE,sep=",")
  daily &lt;- temp[,2]
  dailyreturn &lt;- daily / daily - 1
  temp &lt;- cbind(temp, dailyreturn)
  write.csv(temp, "daily_return.csv")
  </code></pre>
  
  <p>As you can see, the code is almost done. It works as intended, I just have no idea how to introduce the formula into my function.</p>
  
  <p>Thanks in advance! And sorry for such a noob question :-)</p>