Re: [R] How to get the most frequent value of the subgroup

2012-03-30 Thread Milan Bouchet-Valat
Le vendredi 30 mars 2012 à 11:39 -0400, David Winsemius a écrit : > On Mar 30, 2012, at 3:38 AM, Milan Bouchet-Valat wrote: > > > Le jeudi 29 mars 2012 à 09:49 -0500, Yongsuhk Jung a écrit : > >> Dear Members of the R-Help, > >> > >> > >> > >> While using a R function - 'aggregate' that you develo

Re: [R] How to get the most frequent value of the subgroup

2012-03-30 Thread David Winsemius
On Mar 30, 2012, at 3:38 AM, Milan Bouchet-Valat wrote: Le jeudi 29 mars 2012 à 09:49 -0500, Yongsuhk Jung a écrit : Dear Members of the R-Help, While using a R function - 'aggregate' that you developed, I become to have a question. In that function, aggregate(x, by, FUN, ..., simpl

Re: [R] How to get the most frequent value of the subgroup

2012-03-30 Thread Milan Bouchet-Valat
Le jeudi 29 mars 2012 à 09:49 -0500, Yongsuhk Jung a écrit : > Dear Members of the R-Help, > > > > While using a R function - 'aggregate' that you developed, I become to have > a question. > > In that function, > > > > > aggregate(x, by, FUN, ..., simplify = TRUE) > > > > I was wondering

[R] How to get the most frequent value of the subgroup

2012-03-29 Thread Yongsuhk Jung
Dear Members of the R-Help, While using a R function - 'aggregate' that you developed, I become to have a question. In that function, > aggregate(x, by, FUN, ..., simplify = TRUE) I was wondering about what type of FUN I should write if I want to get "the most frequent value of the subgro

Re: [R] How to get the most frequent value of the subgroup

2012-03-29 Thread David Winsemius
On Mar 29, 2012, at 9:30 AM, Jung, Yongsuhk wrote: Dear Members of the R-Help, While using a R function - 'aggregate' that you developed, I become to have a question. In that function, aggregate(x, by, FUN, ..., simplify = TRUE) I was wondering about what type of FUN I should write if

Re: [R] How to get the most frequent value of the subgroup

2012-03-29 Thread R. Michael Weylandt
What you are looking for is commonly called the mode, but (surprisingly?) there doesn't seem to be a standard implementation for mode() in R. (the mode function gives you something else entirely) -- this SO thread may be of help: http://stackoverflow.com/questions/2547402/standard-library-function-

[R] How to get the most frequent value of the subgroup

2012-03-29 Thread Jung, Yongsuhk
Dear Members of the R-Help, While using a R function - 'aggregate' that you developed, I become to have a question. In that function, > aggregate(x, by, FUN, ..., simplify = TRUE) I was wondering about what type of FUN I should write if I want to get "the most frequent value of the subgr