title: How to make a density plot in ggplot2 with dates on the x-axis
body: <p>I have a dataframe <code>df</code> with a column <code>time</code> which contains R date objects and I want to plot a density plot to see which days had the most activity. I don't want to convert to timestamps, because I would prefer more meaningful labels in the x-axis.</p>
  
  <p><strong>My attempt</strong></p>
  
  <p>Here is what I am trying:</p>
  
  <pre><code>ggplot(df, aes(x = time)) + geom_density(stat="identity") + scale_x_date()
  </code></pre>
  
  <p>which gives the error</p>
  
  <pre><code>Error in as.environment(where) : 'where' is missing
  </code></pre>
  
  <p>Here is the output of <code>dput(df)</code>:</p>
  
  <pre><code>structure(list(time = structure(c(15863, 15887, 15865, 15873, 15885, 15878), class = "Date")), .Names = "time", row.names = 8831395:8831400, class = "data.frame")
  </code></pre>