Re: [R] select most frequent value in set of variables

2012-08-24 Thread Sam Dekeyser
AL Petr > To: Sam Dekeyser ; "r-help@r-project.org" > > Cc: > Sent: Monday, August 20, 2012 10:08 AM > Subject: Re: [R] select most frequent value in set of variables > > Hi > > It is really a typical example of a question which has probably very simple > solut

Re: [R] select most frequent value in set of variables

2012-08-22 Thread Jim Lemon
On 08/20/2012 06:48 PM, Sam Dekeyser wrote: Hi, I would like to select the most frequent value level in a set of three variables. Three different observators have judged hair color in study subjects. Mostly they judge the same color, sometimes there is a slight difference. I want to know wha

Re: [R] select most frequent value in set of variables

2012-08-20 Thread arun
quot; "1" "2" "1" "2" "1" "4" "1" "2" "1" "3" [20] "2" gives you the most frequent value in each row of matrix mat. Petr > -Original Message----- > From: r-help-boun...@r-proj

Re: [R] select most frequent value in set of variables

2012-08-20 Thread PIKAL Petr
uot; "2" "1" "4" "1" "2" "1" "3" [20] "2" gives you the most frequent value in each row of matrix mat. Petr > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > proje

[R] select most frequent value in set of variables

2012-08-20 Thread Sam Dekeyser
Hi, I would like to select the most frequent value level in a set of three variables. Three different observators have judged hair color in study subjects. Mostly they judge the same color, sometimes there is a slight difference. I want to know what most of the observators have chosen (so at l

Re: [R] select most frequent value in set of variables

2012-08-20 Thread Sam Dekeyser
I found a solution to this problem myself by searching further and experimenting with some functions. I ended up with a for-loop which iterates over the cases. It generates a table per case, and selects the most frequent (i.e. the value corresponding with the highest frequency) choice, which c