Re: [R] subsetting a matrix based on condition

2009-02-24 Thread Dimitris Rizopoulos
one way is: mat <- matrix(rnorm(2500*12), 2500, 12) ind <- rowSums(mat > 0) > 6 mat[ind, ] I hope it helps. Best, Dimitris A Ezhil wrote: Dear All, I have matrix of size 2500 x 12. I would like to select all the rows if 6 out 12 values are > 0. How can I do that in R? Thanks in advance

[R] subsetting a matrix based on condition

2009-02-24 Thread A Ezhil
Dear All, I have matrix of size 2500 x 12. I would like to select all the rows if 6 out 12 values are > 0. How can I do that in R? Thanks in advance. Kind regards, Ezhil __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-he