title: Add to ggplot with element of different length
body: <p>I'm new to ggplot2 and I'm trying to figure out how I can add a line to an already existing plot I created. The original plot, which is the cumulative distribution of a column of data <code>T1</code> from a data frame <code>x</code>, has about 100,000 elements in it. I have successfully plotted this using ggplot2 and <code>stat_ecdf()</code> with the code I posted below. Now I want to add another line using a set of (x,y) coordinates, but when I try this using <code>geom_line()</code> I get the error message:</p>
  
  <pre><code>Error in data.frame(x = c(0, 7.85398574631245e-07, 3.14159923334398e-06,  : 
  arguments imply differing number of rows: 1001, 100000
  </code></pre>
  
  <p>Here's the code I'm trying to use:</p>
  
  <pre><code>&gt; set.seed(42)
  &gt; x &lt;- data.frame(T1=rchisq(100000,1))
  &gt; ps &lt;- seq(0,1,.001)
  &gt; ts &lt;- .5*qchisq(ps,1) #50:50 mixture of chi-square (df=1) and 0
  &gt; p &lt;- ggplot(x,aes(T1)) + stat_ecdf() + geom_line(aes(ts,ps))
  </code></pre>
  
  <p>That's what produces the error from above. Now here's the code using base graphics that I used to use but that I am now trying to move away from:</p>
  
  <pre><code>plot(ecdf(x$T1),xlab="T1",ylab="Cum. Prob.",xlim=c(0,4),ylim=c(0,1),main="Empirical vs. Theoretical Distribution of T1")
  lines(ts,ps)
  </code></pre>
  
  <p>I've seen some other posts about adding lines in general, but what I haven't seen is how to add a line when the two originating vectors are not of the same length. (Note: I don't want to just use 100,000 (x,y) coordinates.)</p>
  
  <p>As a bonus, is there an easy way, similar to using <code>abline</code>, to add a drop line on a ggplot2 graph?</p>
  
  <p>Any advice would be much appreciated.</p>