[R] mode of a data set

Spencer Graves spencer.graves at pdf.com
Fri Feb 11 23:51:35 CET 2005


      That'll work, provided x is discrete or categorical. 

      Otherwise, the mode is not a well defined concept, as has been 
discussed on this list several times.  I just got 17 hits for a search 
-> "R site search" -> "finding the mode of a distribution from data" 
from "www.r-project.org".  The seventh item on that list was a reply 
from Ted Harding on Sat Dec 13 2003 - 13:13:37 EST to a question subject 
"mode", elaborating on this point.  (The term "mode" is a difficult 
search here, because the R command "mode" returns the storage mode of 
the data, which is unrelated to your question.) 

      hope this helps.  spencer graves

Michael R. Allen wrote:

> I was looking up how to find the mode of a data set in R and found 
> some solutions through your service.  But,  I needed a program to find 
> the mode or modes of a data set.  Here is what I came up with:
>
> names(sort(table(x)))[sort(table(x))==max(sort(table(x)))]
>
> Michael Allen
> Department of Mathematics
> Tennessee Technological University
> Cookeville, TN 38505
> USA
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html




More information about the R-help mailing list