title: How to subtract rows in xts
body: <p>I am using quantmod and I require to find the difference between close value of today and 50th day close value.</p>
  
  <p>I tried like this</p>
  
  <pre><code>library(quantmod) 
  tickers = 'AAPL'
  symbol = getSymbols(tickers,from="2014-04-01",auto.assign=F)
  change =(tail(Cl(symbol), 50)[1]-tail(Cl(symbol), 1)[1])
  change
  </code></pre>
  
  <p>but I am not able to subtract it and getting this error</p>
  
  <pre><code>Data:
  numeric(0)
  
  Index:
  numeric(0)
  </code></pre>