Re: [R] Subscript out of bound error

2013-07-05 Thread Jim Holtman
use 'match' to convert the names to column indices and then use that for indexing indx <- match(subCols, names(yourMatrix) mySubset <- yourMatrix[, indx] Sent from my iPad On Jul 5, 2013, at 2:22, Chirag Gupta wrote: > Hi All > > I have a huge matrix m (10276 X 10276) dimension with same col

[R] Subscript out of bound error

2013-07-05 Thread Chirag Gupta
Hi All I have a huge matrix m (10276 X 10276) dimension with same column name and row names. (its a gene correlation matrix). I have another text file which has 2700 names, basically locus ID of genes, which are also rownames/colnames in m. Now I want to select all those columns from m whose names