Re: [R] xyplot and subscripts

2009-08-13 Thread Deepayan Sarkar
On Thu, Aug 6, 2009 at 7:27 AM, Kito Palaxou wrote: > > Hi all, > > I have a data frame like this: > > DF <- data.frame(x = rnorm(10), y = rnorm(10), gr = rep(1:5, 2)) > > and I make the following xy-plot: > > library(lattice) > xyplot(y ~ x, data = DF, groups = gr, type = "b", col = 1) > > > Is it

Re: [R] xyplot and subscripts

2009-08-13 Thread Juliet Hannah
I'm not sure how to do this in lattice, but here is an option with ggplot2. library(ggplot2) set.seed(123) # Make sure the data has a variable that indicates # which group is red and which one is black DF <- data.frame(x = rnorm(10), y = rnorm(10), gr = rep(1:5, 2),endpoint = c(rep("Red_Group",5)