search for: ifelese

Displaying 1 result from an estimated 1 matches for "ifelese".

Did you mean: if_else
2010 Nov 29
3
question
Hi, is there a way to convert an rpart tree into ifelese statement that codes the data withi factors labeled for the tree? for e.g. if Age>50 and group=B,C then 'Age>50 and group=B,C' if Age<=50 then group=N,A then 'Age<=50 then group=N,A' data$tree<-as.factor(ifelse(Age>50 and group in (B,C), '...