Re: [R] to retrieve specific data from a matrix

2013-09-11 Thread arun
Hi, set.seed(24) mat1<- matrix(sample(0:1,20*100,replace=TRUE),ncol=100,dimnames=list(paste0("Species",1:20),paste0("Species",1:100)))  which(mat1[1,]==1) #or which(!is.na(match(mat1[1,],1))) A.K. - Original Message - From: Elaine Kuo To: "r-help@r-project.org" Cc: Sent: Wednesday,

Re: [R] to retrieve specific data from a matrix

2013-09-11 Thread Berend Hasselman
On 11-09-2013, at 09:38, Elaine Kuo wrote: > Dear list, > > I want to retrieve a specific data from a matrix with 3000 columns. > The matrix has island ID as its rows and species ID as its columns. > There are 20 rows and 3000 columns in the matrix. > (Island ID: Species 1- Species 20/ species