I have a large base and I want to classify the different case we have in fonction of a defined decision tree. For example where resultatD1 = I and diffcd1<3 then data$classification <-"KI". I try to do it with a if :
if (data$final.resultatD1=="I" && diffcd1<3)data$class<-"KI"
and I also though to use a sql procedure but I don't know how to write in an sql procedure :
sqldf("SELECT idR, resultatD1, diffcd1 FROM data WHERE resultatD1='I' and diffcd1<3")
So I don't know how to deal with this problem. Also, I have variable resultatD1 to resultatD7, do you know how can I do to repeat the code for this 7 variable?
I hope I was clear, thank you for your time.