Re: [R] mode of a data set

About this list Date view Thread view Subject view Author view Attachment view

From: Adelchi Azzalini (azzalini@stat.unipd.it)
Date: Tue 24 Jun 2003 - 02:01:07 EST


Message-id: <20030623160108.3634B7CA824@tango.stat.unipd.it>

On Monday 23 June 2003 17:50, Erin Hodgess wrote:
> Dear R People:
>
> Is there a function to find the mode of a data set, please?
>
> This is the mode as in the value(s) which occur most often.
>

 x[rev(order(table(x)))[1]]

is this what you want?

regards
Adelchi Azzalini

-- 
Adelchi Azzalini  <azzalini@stat.unipd.it>
Dipart.Scienze Statistiche, UniversitÓ di Padova, Italia
http://azzalini.stat.unipd.it/

______________________________________________ R-help@stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:12:07 EST