Displaying 1 result from an estimated 1 matches for "count40".
Did you mean:
count10
2012 Oct 12
7
ifelse reformulation
...2
5 5 29 42 39 48 25 35 34
6 6 39 31 30 37 46 43 44
7 7 41 40 25 23 42 40 24
8 8 27 29 47 34 26 38 28
9 9 25 35 29 36 43 34 23
10 10 24 44 37 26 27 46 22
11 11 38 50 32 49 37 24 40
12 12 20 34 48 25 30 41 36
13 13 26 46 20 40 29 20 43
14 14 33 37 49 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)
count4...