Reputation: 9793
library(rpart)
library(rpart.plot)
fit <- rpart(Kyphosis ~ Age + Number + Start, data = kyphosis)
prp(fit, type = 4, extra = 101, leaf.round = 1, fallen.leaves = TRUE,
varlen = 0, tweak = 0.8)
I'm trying to get the text to fit inside the rounded squares. I tried lowering the tweak
and cex
values, but it appears that the rounded squares get smaller along with the text. How can I make the font size smaller?
Upvotes: 2
Views: 22977
Reputation: 801
Using the same package - rpart.plot
fancyRpartPlot(fit,cex=3)
Change cex
as better suites your case, as explained by Otto_k.
Upvotes: 0
Reputation: 341
Try out this graphical package instead:
library(maptree)
draw.tree(fit,cex=3)
Change cex
to get different font sizes.
Upvotes: 4