I am using the R programming language. I ran a decision tree function using the "rpart" library:
library(rpart)
z.auto <- rpart(Mileage ~ Weight, car.test.frame)
From here, I tried to plot the results:
plot(z.auto)
This returns the following plot:
As well as several warning messages:
Warning messages:
1: In doTryCatch(return(expr), name, parentenv, handler) :
"use.n" is not a graphical parameter
2: In doTryCatch(return(expr), name, parentenv, handler) :
"use.n" is not a graphical parameter
3: In doTryCatch(return(expr), name, parentenv, handler) :
"use.n" is not a graphical parameter
4: In doTryCatch(return(expr), name, parentenv, handler) :
"use.n" is not a graphical parameter
5: In doTryCatch(return(expr), name, parentenv, handler) :
"use.n" is not a graphical parameter
6: In doTryCatch(return(expr), name, parentenv, handler) :
"use.n" is not a graphical parameter
7: In doTryCatch(return(expr), name, parentenv, handler) :
"use.n" is not a graphical parameter
8: In doTryCatch(return(expr), name, parentenv, handler) :
"use.n" is not a graphical parameter
9: In doTryCatch(return(expr), name, parentenv, handler) :
"use.n" is not a graphical parameter
I am trying to add more information this plot (such as the variable names and the decision rules). I did some research and found out that you can add labels to this plot:
text(z.auto, use.n=TRUE)
This returns the following plot:
This plot is better - but the text is being cut off towards the bottom. Is there a straightforward way to change the internal size of the plot so that all the text appears without being cut off?
Note: I am using a computer that does not have an internet connection or a USB port - it just has R with some common libraries (e.g. ggplot2, rpart, party, partykit, etc.), I am NOT able to install the "rpart.plot" library on my computer (https://www.rdocumentation.org/packages/rpart.plot/versions/3.0.9), otherwise I would have tried to use this library instead.
Thank you