[R] Measures of central tendency - mode

Patrick E. McKnight pem at theriver.com
Fri Jan 30 21:55:19 CET 2004


Greetings,

This seems too rudimentary to ask but for the life of me I cannot locate a readily easy method to compute the univariate mode.  I know "mode" is not correct and "table" provides a reasonable count but I figured there would be an easy way to extract the value from the table after I do something like:

max(table(mydadat$myvar))

unfortunately it only returns the max count and not the value that is observed most.  Would some kind soul help me out with this seemingly trivial problem?

Thanks in advance.

Cheers,

Patrick




More information about the R-help mailing list