Plot BinaryTree (ctree, party) ignores par () plot parameter

I would like to build a BinaryTree at the top of the plot and make the second in the second part (bottom). Here is an example of code that shows that the tree graph completely ignores the split parameters specified by par ()

par(mfrow=c(1,2))
set.seed(290875)
### regression
airq <- subset(airquality, !is.na(Ozone))
airct <- ctree(Ozone ~ ., data = airq,
controls = ctree_control(maxsurrogate = 3))
airct
plot(airct)
mean((airq$Ozone - predict(airct))^2)
### extract terminal node ID, two ways
all.equal(predict(airct, type = "node"), where(airct))
### classification
irisct <- ctree(Species ~ .,data = iris)
irisct <- ctree(Species ~ .,data = iris)

This code does not display two (identical) trees in the same section (page). How can i fix this?

Even if after a very detailed answer it doesn’t work in this case: the plots created by "plot" and "ggplot" side by side building ctree ignores all the set parameters.

+4
source share

All Articles