Re: [R] Plot a matrix recursively

2010-12-20 Thread AlexZolot
for data.frame: for(j in grep('Laser_', names(m)) lines(m[,j]) for matrix: for(j in grep('Laser_', colnames(m)) lines(m[,j]) or: for(j in 2:4) lines(m[,j]) Shorter could be worse if you insert additional columns later. alcesgabbo wrote: > > Hi, > > I have the following matrix (named

Re: [R] Plot a matrix recursively

2010-12-20 Thread AlexZolot
for data.frame: for(j in grep('Laser_', names(m)) lines(m[,j]) for matrix: for(j in grep('Laser_', colnames(m)) lines(m[,j]) or for(j in 2:4) lines(m[,j]) Shorter could be worse if you insert additional columns later. -- View this message in context: http://r.789695.n4.nabble.com/Plot-a-m

Re: [R] Plot a matrix recursively

2010-12-01 Thread alcesgabbo
thanks! very useful -- View this message in context: http://r.789695.n4.nabble.com/Plot-a-matrix-recursively-tp3067283p3067443.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mail

Re: [R] Plot a matrix recursively

2010-12-01 Thread Roland Rau
On 12/01/2010 02:43 PM, alcesgabbo wrote: I plot the first column with the following function: plot(m[,1],type="o", xaxt="n",ylim=c(min(m[,1:length(colnames(m))])-1, max(m[,1:length(colnames(m))])+1)) for the other columns I use there functions: lines(m[,2],type=\"o\") lines(m[,3],type=\"o\")

Re: [R] Plot a matrix recursively

2010-12-01 Thread Gerrit Eichner
Take a look at ?matplot HTH, Gerrit On Wed, 1 Dec 2010, alcesgabbo wrote: Hi, I have the following matrix (named m): key sensor_date Laser_1 Laser_2 Laser_3 2010-09-30T15:00:12+02006