You need to wrap an aes() around the yintercept, since it is a
variable (and hence an aesthetic of the plot). So using my previous
reply where gp replaces group as a variable name, this works:
ggplot(myDf) + geom_point(aes(x = x, y = y)) +
geom_hline(aes(yintercept=mean) ) +
facet_wrap(~ gp, scales = 'free', nrow = 1)
HTH,
Dennis
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
geom_hline() uses yintercept = as an argument; geom_vline() uses
xintercept = instead. See http://had.co.nz/ggplot2/geom_hline.html and
http://had.co.nz/ggplot2/geom_vline.html. More generally, the page
http://had.co.nz/ggplot2/ contains an on-line help system for 0.8.9
which contains many worked examples (scroll towards the bottom of the
page to find them).
Dennis
>> > To unsubscribe: email ggplot...@googlegroups.com