title: How to plot a lagged time series?
body: <p>I am trying to draw some quick graphs for exploratory analysis and have the following question: </p>
  
  <p>How can I plot a lagged time series in ggplot? I am trying to do something like this:</p>
  
  <pre><code> ggplot(data,aes(x=xdata,y=xdata-1)+geom_point()
  </code></pre>
  
  <p>But <code>xdata-1</code> is subtracting 1 from <code>xdata</code> instead of reading the previous <code>xdata</code> value. </p>
  
  <p><code>ggplot</code> does not seem to have a <code>lag.plot</code> equivalent and I did find a function called <code>gglagplot</code> in the <code>ggfortify</code> package that seems to be exactly what I want but that is not available in the latest version of R (currently 3.2).</p>