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

2011-04-14 Thread Dennis Murphy
Hi: Here's an example: m <- as.data.frame(matrix(rnorm(1), nrow = 100)) dim(m) [1] 100 100 # Assign rownames to rows of m rownames(m) <- paste('A', 1:100, sep = '') # Select a random subset of the rownames vn <- sample(rownames(m), 50) # Subset m by selecting the rownames from vn m2 <- m[ro

Re: [R] Extracting selected rows from a matrix

2010-11-29 Thread Kjetil Halvorsen
see below. On Mon, Nov 29, 2010 at 5:56 PM, pankaj borah wrote: > Hi, > > I have matrix of 104 columns and 3 rows (Each Row has rowname). > > I have 13 different  list of selected rownames (character) say 1000 each. Now > I want to extract the all the columns according to the rownames in eac