[R] determine frequencies in a matrix by row

the_big_kowalski bkowalski at csumb.edu
Wed Jun 8 08:23:22 CEST 2011


Hi, 

I have a matrix 
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    3    1    1    3    1    1    2    3     2
[2,]    1    3    1    2    1    1    1    2    2     1
[3,]    1    2    2    3    2    1    1    1    2     1
[4,]    3    2    1    1    1    3    1    2    1     2
[5,]    1    1    2    2    1    1    3    1    1     2
and want to determine how many times 1s, 2s, and 3s occur per each row.
I tried using 'table', but end up with frequencies for the whole matrix.
Thanks in advance for your help

--
View this message in context: http://r.789695.n4.nabble.com/determine-frequencies-in-a-matrix-by-row-tp3581733p3581733.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list