[R] How to subset a portion of columns from a matrix

affy snp affysnp at gmail.com
Sat Nov 10 04:58:20 CET 2007


Dear List,

Hi! I am wondering what is the simplest way to subset a portion of columns
from a matrix.

For example, there is a matrix A (238,304*243). What is the simplest
way to get a sub-matrix B which comprises of column 1, 3, 5, 7,9,...(odd column
number) from matrix A?

Thank you very much for your help!

Best,
     Allen



More information about the R-help mailing list