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

hadley wickham h.wickham at gmail.com
Wed Feb 27 00:02:24 CET 2008


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 <juryef at yahoo.com> 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$tx==i])
>  }
>
>
>  Thank you,
>
>  Judith
>
>
>
>       ____________________________________________________________________________________
>  Be a better friend, newshound, and
>
>  ______________________________________________
>  R-help at 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.
>



-- 
http://had.co.nz/



More information about the R-help mailing list