Hi there,

I have a matrix (n*m) which rows including 0,1,2
I want to know the frequency of each elements (0 , 1 , 2) separately for
each row!
for example :

     1    2    3   4    5    6     7

A   0     1   1    0     2    2    2
B   1     1   1    2    0    0     2
C   2    1   1    0     0    0    2
D   1     1   0    0    0    2     2
E   0     2   1    1     2    2    2

I want to this output:

     1    2    3   4    5    6     7         fr0
fr1               fr2

A   0     1   1    0     2    2    2           2                  2
     3
B   1     1   1    2    0    0     2           3
2             2
C   2    1   1    0     0    0     2          3                   2
     2
D   1     1   0    0    0    2     2           2                  3
        2
E   0     2   1    1     2    2    2           1
2            4

Thanks

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to