Re: [R] Error loop: missing value where TRUE/FALSE needed

2011-02-25 Thread Seeliger . Curt
> I often get this error "missing value where TRUE/FALSE needed" when > I'm doing some loops, like with this one > > ... > Can someone explain me what I do wrong because I don't see the > difference with other loops that work It's probably not the loop that's biting you, but rather the data. T

[R] Error loop: missing value where TRUE/FALSE needed

2011-02-25 Thread sarah bauduin
Dear R-help community, I often get this error "missing value where TRUE/FALSE needed" when I'm doing some loops, like with this one for (i in 1:nrow(survey)) { if (survey[i,7]==survey[i,3]) {survey[i,14]<-survey[i,6]} else if(survey[i,11]==0 && survey[i,12]==0) {survey[i,14]<-sur