[R] Creating Sub-Matrix

Philipp Pagel p.pagel at wzw.tum.de
Sat Jan 31 14:56:21 CET 2009

> How do I get sub-matrix? Example, I would like to get matrix of size 3x7
> from the matrix of size 4x7. Meaning that I try to exclude one row of the
> original matrix.

Just exclude the row by negative indexing - e.g. foo[-2,]

You may want to consider reading the "Introduction to R" where all these
concepts are explained to new users.


Dr. Philipp Pagel
Lehrstuhl für Genomorientierte Bioinformatik
Technische Universität München
Wissenschaftszentrum Weihenstephan
85350 Freising, Germany

More information about the R-help mailing list