Re: [R] graphics - joining repeated measures with a line

2006-09-07 Thread hadley wickham
> I would like to join repeated measures for patients across two visits using > a line. The program below uses symbols to represent each patient. Basically, > I would like to join each pair of symbols. This is easy in ggplot: install.packages("ggplot") library(ggplot) qplot(visit, var, id=patien

Re: [R] graphics - joining repeated measures with a line

2006-09-06 Thread Gabor Grothendieck
Just one correction (although in this case it does not change the output) -- use group = patient rather than group = symbol[patient]: xyplot(var ~ visit, group = patient, type = "b", auto.key = list(space = "right"), par.settings = list(superpose.symbol = list(pch = symbols))) On 9/6/06, Gabo

Re: [R] graphics - joining repeated measures with a line

2006-09-06 Thread Gabor Grothendieck
Make each pair of points a separate group using group= and specify that both points and lines be used via type = "b". Also set the symbols in par.settings= so that they are accessed by both the main plot and the legend: xyplot(var ~ visit, group = symbols[patient], type = "b", auto.key = list(

[R] graphics - joining repeated measures with a line

2006-09-06 Thread Murray Pung
I would like to join repeated measures for patients across two visits using a line. The program below uses symbols to represent each patient. Basically, I would like to join each pair of symbols. library(lattice) patient <- c(1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9) var <- c(826,119,168,90,572,323,