Re: [R] maximum of identical elements in a vector

2008-03-30 Thread Daniel Malter
: [R] maximum of identical elements in a vector On 3/30/2008 5:35 PM, Daniel Malter wrote: > Hi, > > the problem I have is seemingly very simple, but not simple enough for > me to figure out. I just want to find the most (or least) frequent > element in the vector. > > a=c(&

Re: [R] maximum of identical elements in a vector

2008-03-30 Thread Gavin Simpson
On Sun, 2008-03-30 at 17:35 -0400, Daniel Malter wrote: > Hi, > > the problem I have is seemingly very simple, but not simple enough for me to > figure out. I just want to find the most (or least) frequent element in the > vector. > > a=c("Alice","Alice","Alice","Alice","Bob","Bob") > unique(a) >

Re: [R] maximum of identical elements in a vector

2008-03-30 Thread Chuck Cleland
On 3/30/2008 5:35 PM, Daniel Malter wrote: > Hi, > > the problem I have is seemingly very simple, but not simple enough for me to > figure out. I just want to find the most (or least) frequent element in the > vector. > > a=c("Alice","Alice","Alice","Alice","Bob","Bob") > unique(a) > length(which

[R] maximum of identical elements in a vector

2008-03-30 Thread Daniel Malter
Hi, the problem I have is seemingly very simple, but not simple enough for me to figure out. I just want to find the most (or least) frequent element in the vector. a=c("Alice","Alice","Alice","Alice","Bob","Bob") unique(a) length(which(a=="Alice")) unique(a) shows me that the elements in my ve