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

2012-08-24 Thread Sam Dekeyser
Sam Op 20-aug-2012, om 18:04 heeft arun het volgende geschreven: > HI, > > Slightly different way: > unlist(lapply(apply(mat,1,count),function(x) max(x[2]))) > #[1] 2 1 2 1 1 2 2 2 2 1 2 1 2 2 2 1 1 1 2 2 > > > > - Original Message - > From: PIK

[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
color3[i] if(is.null(color)) { ss$color_med[i] <- NA } else { ss$color_med[i] <- as.integer(color) } } Greetings! Sam Op 20-aug-2012, om 10:48 heeft Sam Dekeyser het volgende geschreven: > Hi, >