I have a matrix
with row and col names and want to reduce it to a submatrix
certain row / colnames. The specified names are in a string vector of ~20
values, while the matrix has 55.000 rownames
and 805 colnames
. How can I do this efficiently in R?
IFNGenes = c('TIMM10','UBE2L6','MX1','IF16','IFI44L','IFIT3','ISG15','OAS1','RSAD2','IFI44','OAS3','DOX58','HERC5','BATF2','LIPA','RSAD2.1')
subMatrix = theMatrix[,IFNGenes]
Error in theMatrix[, IFNGenes] : subscript out of bounds