[R] Extracting selected rows from a matrix to a submatix

From: pankaj borah <pankajborah2k3_at_yahoo.co.in>
Date: Wed, 13 Apr 2011 21:43:26 +0530 (IST)


I have a matrix M

> dim(M)

[1] 30380   561

I have another list L contains , that contains some row names of matrix M str (L)
 chr [1:21037]

Now I want to extract the submatrix subM (21037    ,    561)  from the matrix M by matching the rownames (M) to the 21037 rownames o f L

How do I do that ?

Thanks and regards,

Pankaj Barah

 

Pankaj Barah Department of Biology
 Norwegian University of Science & Technology (NTNU)   Realfagbygget, N-7491 Trondheim, Norway T

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 14 Apr 2011 - 06:42:52 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 14 Apr 2011 - 07:10:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive