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
elect most frequent value in set of variables Hi It is really a typical example of a question which has probably very simple solution but hardly anybody can give you a rasonable answer. How your data look like? What is the structure of your data? set.seed(1) x<-sample(1:4, 60, replace=T) mat

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

2012-08-20 Thread PIKAL Petr
Hi It is really a typical example of a question which has probably very simple solution but hardly anybody can give you a rasonable answer. How your data look like? What is the structure of your data? set.seed(1) x<-sample(1:4, 60, replace=T) mat<-as.factor(x) dim(mat) <- c(20,3) > sapply(appl

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