title: Basic question on how to get next/previous element in xts
body: <p>I have a very basic question... Suppose I can get a closing price for specific symbol for current date in an xts object using </p>
  
  <pre><code>closePrice&lt;-as.double(Cl(get(symbol))[currentDate]) 
  </code></pre>
  
  <p>How can I get close price on the trading day one day, two days, three days, ... or n days before/after? </p>
  
  <pre><code>closePriceNDaysBefore&lt;-as.double(Cl(get(symbol))[currentDate - n]) 
  </code></pre>
  
  <p>is not ok...</p>
  
  <p>Thanks in advance.</p>
  
  <p>Kind regards,
  Samo.</p>