Hi, I came across the below error when I try to do ifelse condition:-
Error in "[<-"(`*tmp*`, test, value = rep(yes, length = length(ans))[test]) : incompatible types What I am trying to accomplish is :- for(x in 1:ncol(filterpred)){ sumno<-sum(filterpred[no,x]) sumyes<-sum(filterpred[yes,x]) ifelse(sumno==0 && sumyes !=0, filterpred[,x]<-NULL,filterpred[,x]<-filterpred[,x]) } Anything wrong here? Please advise. Thanks. [[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.