Skip to content
Prev 58480 / 398502 Next

keep dimension of a sub matrix

See

 > help("[")

which informs you about the additional argument "drop":

 > ret <-matrix(1,4,4)[i1:i2,j1:j2,drop=FALSE] ;

BTW, you do not need to end lines of code with a ";" ...

Eric
At 12:06 4/11/2004, JC Vaugeois wrote:
Eric Lecoutre
UCL /  Institut de Statistique
Voie du Roman Pays, 20
1348 Louvain-la-Neuve
Belgium

tel: (+32)(0)10473050
lecoutre at stat.ucl.ac.be
http://www.stat.ucl.ac.be/ISpersonnel/lecoutre

If the statistics are boring, then you've got the wrong numbers. -Edward 
Tufte