[R] Plot matrix as many lines

Alberto Monteiro albmont at centroin.com.br
Fri Jun 6 21:01:01 CEST 2008

Suppose that I have a matrix like:

m <- rbind(c(1,2,3,4), c(2,3,2,1))

Is there any way to efficiently plot the _lines_ as if
I was doing:

plot(m[1,], type="l")
points(m[2,], type="l", col="red")

(of course, in the "real world" there much more than
just 2 lines and 4 columns...)

Alberto Monteiro

More information about the R-help mailing list