title: horizontal line on a plot with a date axis
body: <p>I'm keeping track of when and for how long my cats poop in a data.frame:</p>
  
  <pre><code>df &lt;- data.frame(name=c("fluffy", "misterCuddles", "senorEsnuggle"))
  df$start=as.POSIXlt(c("2014-04-03 23:57", "2014-04-03 23:31", "2014-04-04 00:02"), tz="EST")
  df$duration=c(123, 234, 345)
  </code></pre>
  
  <p>Now my <code>df</code> looks like:</p>
  
  <pre><code>           name               start duration
  1        fluffy 2014-04-03 23:57:00      123
  2 misterCuddles 2014-04-03 23:31:00      234
  3 senorEsnuggle 2014-04-04 00:02:00      345
  </code></pre>
  
  <p>I can plot this like so:</p>
  
  <pre><code>ggplot(df, aes(x=name)) + 
      geom_linerange(aes(ymin=start, ymax=start + duration), size=10)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/AbI3X.png" alt="enter image description here"></p>
  
  <p>How do I put a horizontal line at midnight, to separate April 3rd from April 4th? </p>
  
  <p>When I try this:</p>
  
  <pre><code>ggplot(df, aes(x=name)) + 
      geom_linerange(aes(ymin=start, ymax=start + duration), size=10) +
      geom_hline(yintercept=as.POSIXlt("2014-04-04 00:00", tz="EST"))
  </code></pre>
  
  <p>I get the following error message:</p>
  
  <pre><code>Error : Invalid intercept type: should be a numeric vector, a function, or a name of a function
  </code></pre>