Re: [R] color lines by group membership in spaghetti plot

2010-05-14 Thread Dennis Murphy
Hi: Here's an example from the ggplot2 package using the Orthodont data from Pinheiro & Bates (2000): library(nlme) library(ggplot2) p <- ggplot(data = Orthodont, aes(x = age, y = distance, group = Subject, colour = Sex)) p + geom_line() ?Orthodont will give you some

[R] color lines by group membership in spaghetti plot

2010-05-14 Thread Jack Monpas-Huber
Greetings, I am new to R. Right now I'm most interested in the spaghetti plots of achievement over time by student ID associated with longitudinal analysis. How can I do a spaghetti plot of all students, but color the lines by group membership such as gender or race, and indicate this color sche