Skip to content
Prev 17042 / 398502 Next

something missing from the graph of recursive partitioning

Hi
The text is being clipped to the plot boundaries.  The following minor
adjustment to your code shows where the clipping is occurring [indicated by
a dashed box around the plot boundary] and a possible fix [via par(xpd)]:

library(rpart)
data(kyphosis)
fit <- rpart(Kyphosis ~ Age + Number + Start, data =
kyphosis)
fit2 <- rpart(Kyphosis ~ Age + Number + Start, data =
kyphosis,
parms = list(prior = c(0.65, 0.35), split =
"information"))
postscript("rpart.ps", width=960, height=960)
par(mfrow = c(1, 2))
par(xpd=NA)  # or par(xpd=T)
plot(fit)
text(fit, use.n = TRUE)
box("plot", lty="dashed")
plot(fit2)
text(fit2, use.n = TRUE)
box("plot", lty="dashed")
dev.off()

Paul



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._