Displaying 1 result from an estimated 1 matches for "t2all".
Did you mean:
t1all
2010 Mar 05
2
Selecting rows of a matrix based on some condition on the columns
....40 38.57 34.19 32.47
[8,] 87 35.22 0 0.00 35.31 0.00 0.00 34.55 35.14 38.12 0.00
[9,] 99 0.00 0 34.94 0.00 0.00 33.54 0.00 34.39 34.54 0.00
Then, I need the rows for which there are at least two T's and two C's. Using a similar code as above, I get the following output:
> t2all <- apply(xy,1,function(x) any(((x[2]>0&x[3]>0)|(x[2]>0&x[4]>0)|
+ (x[2]>0&x[5]>0)|(x[2]>0&x[6]>0)|(x[3]>0&x[4]>0)|(x[3]>0&x[5]>0)|
+ (x[3]>0&x[6]>0)|(x[4]>0&x[5]>0)|(x[4]>0&x[6]>0)|(x[5]>0&x[6]>0)...