Re: [R] xyplot, groups and colors

2011-04-11 Thread Philipp Pagel
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

Re: [R] xyplot, groups and colors

2011-04-08 Thread Dennis Murphy
Hi: This seems to 'work': xyplot(circumference~age, dat, groups=Tree, type='l', col.line = c('red', 'blue', 'blue', 'red', 'red')) 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(circu

Re: [R] xyplot, groups and colors

2011-04-08 Thread Jeremy Hetzel
Philipp, I would do the following with ggplot2: # Set up data require(ggplot2) dat <- Orange dat$group <- ifelse(dat$Tree%in%c('1','4','5'), 'A', 'B') # Specify the ggplot group aesthetic as Tree g1 <- ggplot(data = dat, aes(x = age, y = circumference, group=Tree)) # Specify the geom_point and

Re: [R] xyplot, groups and colors

2011-04-08 Thread David Winsemius
On Apr 8, 2011, at 8:06 AM, Philipp Pagel wrote: Dear ExpeRts, I am trying to plot a bunch of growth curves and would like to get some more control over groups and line colors than I seem to have. Example: # make some data dat <- Orange dat$group <- ifelse(dat$Tree%in%c('1','4','5')

[R] xyplot, groups and colors

2011-04-08 Thread Philipp Pagel
Dear ExpeRts, I am trying to plot a bunch of growth curves and would like to get some more control over groups and line colors than I seem to have. Example: # make some data dat <- Orange dat$group <- ifelse(dat$Tree%in%c('1','4','5'), 'A', 'B') # plot xyplot(circumference~age, dat, gr