RE: [R] How to plot a matrix with 18 rows by row vs. a vector in a single graph, resulting 18 lines with different colors?

From: Liaw, Andy <andy_liaw_at_merck.com>
Date: Thu 12 May 2005 - 01:41:32 EST


See ?matplot. E.g.,

matplot(time, t(gene), type="b", lty=1)

Andy

> From: Xiao Shi
>
> I have a matrix gene=array(rnorm(180), dim=c(18,10)) and a
> vector time=c(0,
> 0.5,2,4,6,8,12,24,48,72).
> So i can get a plot with
> plot(time,gene[1,],type="b",col="green") for the
> first row.So how can i get all the 18 rows in the same plot
> VS. the same
> vector time=c(0,0.5,2,4,6,8,12,24,48,72).
> Any suggestions.Thanks !
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu May 12 01:50:06 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:41 EST