Dear All, I am getting this error and don't know why it comes. can you please help ?
Error in if (data$Rain[i_NA] == 60) { : missing value where TRUE/FALSE needed The loop is : indicNAs <- which(data$Rain %in% NA) ind_nonleap = c() # NAs due to non leap years ind_nonrecord = c() # NAs due to non recording values for (i_NA in indicNAs ){ if(data$Rain[i_NA] == 60){ ind_nonleap <- append(ind_nonleap,i_NA) } else { ind_nonrecord<-append(ind_nonrecord,i_NA) } #cat(ind_nonrecord) #cat( ind_nonleap) } ind_nonleap Regards, Frederic. Frederic Ntirenganya Maseno University, African Maths Initiative, Kenya. Mobile:(+254)718492836 Email: fr...@aims.ac.za https://sites.google.com/a/aims.ac.za/fredo/ [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.