search for: count40aux

Displaying 1 result from an estimated 1 matches for "count40aux".

2012 Oct 12
7
ifelse reformulation
...31 47 30 30 15 15 43 39 27 35 48 47 27 count40<-ifelse(test$x1==40|test$x2==40|test$x3==40|test$x4==40|test$x5==40|test$x6==40|test$x7==40,0,1) count40 I'm trying to remake that ifelse. If any variable from x1 to x7 equals to 40 --> 0, else --> 1 I was trying to do something like: count40aux<-ifelse(test[,2:8]==40,0,1) count40aux It doesn't work as i expected... Can anyone help me please? Regards, Bruno -- View this message in context: http://r.789695.n4.nabble.com/ifelse-reformulation-tp4645981.html Sent from the R help mailing list archive at Nabble.com.