title: Plotting an xts object using ggplot2
body: <p>I'm wanting to plot an xts object using ggplot2 but getting an error. Here is what I'm doing: </p>
  
  <pre><code>dates &lt;- c("2014-10-01", "2014-11-01", "2014-12-01", "2015-01-01", "2015-02-01")
  value &lt;- as.numeric(c(3, 4, 5, 6, 5))
  new_df &lt;- data_frame(dates, value)
  new_df$dates &lt;- as.Date(dates)
  new_df &lt;- as.xts(new_df[,-1], order.by = new_df$dates)
  </code></pre>
  
  <p>Now I try to plot it using ggplot2:</p>
  
  <pre><code>ggplot(new_df, aes(x = index, y = value)) + geom_point()
  </code></pre>
  
  <p>I get the following error: </p>
  
  <blockquote>
    <p>Error in (function (..., row.names = NULL, check.rows = FALSE,
    check.names = TRUE,  :   arguments imply differing number of rows: 0,
    5</p>
  </blockquote>
  
  <p>I'm not quite sure what it is that I'm doing wrong.</p>