geom_hline and qplot

25 views
Skip to first unread message

David Hajage

unread,
Mar 27, 2009, 12:30:50 PM3/27/09
to ggplot2
Hello,

I don't understand the difference between this two examples :

p <- qplot(x = mtcars$wt, y=mtcars$mpg) # Doesn't work
p
p + geom_hline(yintercept=20)
Erreur dans data.frame(..., check.names = FALSE) :
  les arguments impliquent des nombres de lignes différents : 32, 1

q <- qplot(x = wt, y=mpg, data = mtcars)  # Works
q + geom_hline(yintercept=20)

I know that it is better to work with one data.frame instead of two vectors, but I would like to know why the first example doesn't work...

Thank you very much.

David

hadley wickham

unread,
Mar 27, 2009, 12:45:47 PM3/27/09
to David Hajage, ggplot2

It's a bug and is fixed in the development version.

Hadley

--
http://had.co.nz/

David Hajage

unread,
Mar 27, 2009, 1:27:44 PM3/27/09
to ggplot2
Woow, it's fast.

David
Reply all
Reply to author
Forward
0 new messages