I'd like to achieve picture like this,
The following is what I have now:
How can I modify the code to acquire the picture? I mean,how to remove the $err and $distribution in terminal nodes? I have read the Rdocumentation for party-plot but in vain. Thanks in advance.
library(openxlsx)
library('partykit')
data<- read.xlsx("2005.XLSX", sheet = 1)
tree<-ctree(inc_total~.,data=data,control = ctree_control(maxdepth = 5))
plot(tree,type='simple',inner_panel=node_inner(tree,id=FALSE),
terminal_panel = node_terminal(tree,digits=1,id=FALSE,fill=c('white','white'),width = 14,gp=gpar(fontsize=5)))
mean((data$inc_total-predict(tree))^2)