tree <- rpart(hit ~. , data = train, control = rpart.control(minbucket = 5))
plot(tree, main = "Decision Tree")
text(tree)
(I deleted independent variable names from the image)
My problem is that factor names written as 'a', 'b', 'c', bcdefghijl', and 'bfgj' etc., instead of the real factor names. I tried both of the code below, but not resolving the issue. How to fix it?
df$var1<-as.factor(df$var1)
df$var1<-as.factor(as.character(df$var1))