Hi, I have what I think is a simple question/issue but I have unable to find 
the answer for it either in the R-manual or by browsing the web.

 

I would like to know if there is a "mode" function in R, such that from a 
vector or matrix the function returns the most common value.  In other programs 
I use (such as Matlab) I can have for exampe a 3X3 matrix A, A=[1 2 3; 1 3 2; 3 
3 2] and I can find the mode of the rows so that mode(A[1:3,:]) returns a 1X3 
matrix [1 3 2].

 

Is this possible in R as well?  If not, how would one go about this?

 

Thank you very much,

 

Bill
                                          
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
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