Re: [R] Multiple lines with a different color assigned to each line (corrected code)

2008-02-27 Thread Jim Lemon
Judith Flores wrote: > Sorry, I just realized I didn't type in the correct > names of the variables I am working with, this is how > it should be: > > plot(1,1,type="n") > for (i in summ$tx) { > >points(summ$timep[summ$tx==i],summ$mn[summ$tx==i]) >lines(summ$timep[summ$tx==i],summ$mn[summ

Re: [R] Multiple lines with a different color assigned to each line (corrected code)

2008-02-26 Thread hadley wickham
It's hard to provide a useful answer without know what your data looks like, but maybe something like: library(ggplot2) qplot(timep, mn, data=summ, geom="line", colour = tx) Hadley On Tue, Feb 26, 2008 at 4:24 PM, Judith Flores <[EMAIL PROTECTED]> wrote: > Sorry, I just realized I didn't type in

[R] Multiple lines with a different color assigned to each line (corrected code)

2008-02-26 Thread Judith Flores
Sorry, I just realized I didn't type in the correct names of the variables I am working with, this is how it should be: plot(1,1,type="n") for (i in summ$tx) { points(summ$timep[summ$tx==i],summ$mn[summ$tx==i]) lines(summ$timep[summ$tx==i],summ$mn[summ$tx==i]) } Thank you, Judith

Re: [R] Multiple lines with a different color assigned to each line

2008-02-26 Thread John Kane
I am not sure if I completely understand but would something like this work? (not tested) points( col=i) lines ( col=i=1) --- Judith Flores <[EMAIL PROTECTED]> wrote: > Dear R-experts, > >I want to assign different colors to groups of > points, lines and segments in a plot. > > I

[R] Multiple lines with a different color assigned to each line

2008-02-26 Thread Judith Flores
Dear R-experts, I want to assign different colors to groups of points, lines and segments in a plot. I have a vector(dat$tx) that is going to have a different number of levels every time the user wants to plot a set of data. The number of lines is going to be equal to the number of levels of