[R] profile plot in R

Joshua Wiley jwiley.psych at gmail.com
Sat Jun 18 17:24:01 CEST 2011


Hi,

Another easy option would be to convert your data to "long" format and then use ggplot2 or lattice.  Something like (though not exact without a reproducible example):

require(ggplot2)
long.dat <- melt(your_data, arguments)

ggplot(long.dat, aes(x = variable, y = value)) +
  geom_line(aes(colour = group)) +
  facet_grid(~ condition)

HTH,

Josh

On Jun 17, 2011, at 12:43, Vickie S <isvik at live.com> wrote:

> 
> Hi friends,
> 
> I have a matrix with following format.
> 
>   group var1 var2 .......varN
> 
> c1 group1 1.2399 1.4990....-1.4829
> 
> c2 group4 0.8989 0.7849.....1.8933
> 
> ...
> 
> ...
> 
> c100 group10 .....
> 
> 
> 
> I want to draw a profile plot
> of each condition c1 to c100, which rows in above matrix and each line
> representing a row  should be uniquely colored according to the group(1
> to 10).
> 
> I think this is simple task but I could not figure out how to set the colors.
> 
> 
> 
> Any help would be appreciated.
> 
> 
> 
> thanks
> 
> -Vickie                         
>    [[alternative HTML version deleted]]
> 
> ______________________________________________
> 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.



More information about the R-help mailing list