[R] The most common row in a matrix?

kone attenka at utu.fi
Sun Nov 19 20:31:29 CET 2006


Hi,

How do you get the most common row from a matrix? If I have a matrix  
like this

array(1:3,dim=c(4,5))

      [,1] [,2] [,3] [,4] [,5]
[1,]    1    2    3    1    2
[2,]    2    3    1    2    3
[3,]    3    1    2    3    1
[4,]    1    2    3    1    2

in which rows 1 and 4 are similar, I want to find that vector c 
(1,2,3,1,2).

Atte Tenkanen
University of Turku, Finland



More information about the R-help mailing list