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/

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to