[R] lattice: add vertical lines in xyplot

2008-08-07 Thread baptiste auguie
Hi list, This is a very basic question about lattice: I wish to add some vertical lines in each panel of a xyplot as demonstrated in this example: library(lattice) xx - seq(1, 10, length=100) x - rep(xx, 4) y - c(cos(xx), sin(xx), xx, xx^2/10) fact - factor(rep(c(cos, sin, id, square),

Re: [R] lattice: add vertical lines in xyplot

2008-08-07 Thread Deepayan Sarkar
On Thu, Aug 7, 2008 at 11:54 AM, baptiste auguie [EMAIL PROTECTED] wrote: Hi list, This is a very basic question about lattice: I wish to add some vertical lines in each panel of a xyplot as demonstrated in this example: library(lattice) xx - seq(1, 10, length=100) x - rep(xx, 4) y -

Re: [R] lattice: add vertical lines in xyplot

2008-08-07 Thread hadley wickham
Alternatively, I tried in ggplot but here again, I get an error: p - ggplot(my.df, aes(x, y)) + geom_path(aes(colour = fact)) + facet_grid(fact2 ~ fact) + geom_vline(intercept = my.lines) # how do I select the relevant one ? If you want a different

Re: [R] lattice: add vertical lines in xyplot

2008-08-07 Thread baptiste auguie
Many thanks Deepayan, it works nicely (i always need simple examples to understand the help page for some reason). Also, Hadley, I can't get this example from ggplot2's website to work: # Slopes and intercepts as data p - ggplot(mtcars, aes(x = wt, y=mpg), . ~ cyl) + geom_point() df