I am plotting a decision tree
using the party
package. When running the plot(tree)
function, it plots the decision tree
. However, I want to change the font size of the node
labels
and I am using the following codes:
tree<-ctree(Attrition~MaritalStatus+Age_group,data=traindf1)
plot(tree)
text(tree, cex = 0.5)
When running the last line of code, I get the following error message:
Error in as.double(y) :
cannot coerce type 'S4' to vector of type 'double'
I had a look at this post but it seems to relate to another package: Error in as.double(y) : cannot coerce type 'S4' to vector of type 'double'
How can I fix this?