xyplot, groups and colors
On Fri, Apr 08, 2011 at 08:14:21AM -0700, Dennis Murphy wrote:
Thanks to everyone who replied! Especialy this and the ggplot advice did what I wanted.
xyplot(circumference~age, dat, groups=Tree, type='l',
col.line = c('red', 'blue', 'blue', 'red', 'red'))
This is essentially what I had been doing after somehow creating the correct color vector.
After a little more fiddling around, this also works, and seems a bit less
kludgy:
dat$group2 <- factor(dat$group, labels = c('red', 'blue'))
xyplot(circumference~age, dat, groups=Tree, type='l',
col.line = levels(dat$group2))
Perfect! Using the levels directly had not occured to me. Thanks! cu Philipp
Dr. Philipp Pagel Lehrstuhl f?r Genomorientierte Bioinformatik Technische Universit?t M?nchen Wissenschaftszentrum Weihenstephan Maximus-von-Imhof-Forum 3 85354 Freising, Germany http://webclu.bio.wzw.tum.de/~pagel/