[R] Counting in Matrix

Tom Pitt t.pitt at hotmail.com
Tue Dec 15 21:56:58 CET 2009


Hi All,

Is there an easy way to count "TRUEs" for each row?

Thanks,
Tom


      x1    x2    x3    x4
1   TRUE  TRUE  TRUE  TRUE
2  FALSE  TRUE  TRUE  TRUE
3   TRUE FALSE  TRUE  TRUE
4  FALSE FALSE  TRUE  TRUE
5   TRUE  TRUE FALSE  TRUE
6  FALSE  TRUE FALSE  TRUE
7   TRUE FALSE FALSE  TRUE
8  FALSE FALSE FALSE  TRUE
9   TRUE  TRUE  TRUE FALSE
10 FALSE  TRUE  TRUE FALSE
11  TRUE FALSE  TRUE FALSE
12 FALSE FALSE  TRUE FALSE
13  TRUE  TRUE FALSE FALSE
14 FALSE  TRUE FALSE FALSE
15  TRUE FALSE FALSE FALSE
-- 
View this message in context: http://n4.nabble.com/Counting-in-Matrix-tp964644p964644.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list