I would like to plot a tree resulting from glmtree (partykit package). Unfortunately, the terminal nodes are overlapping and the labels of the graphs are no longer displayed properly.
The code that generates the tree is this one:
library(partykit)
library(aVirtualTwins)
data(sepsis)
attach(sepsis)
data <- cbind(y = survival, trt = as.factor(THERAPY), sepsis[,3:13])
formula <- as.formula(paste("y ~ trt", paste(names(sepsis[,3:13]),
collapse = " + "), sep = " | "))
fit <- glmtree(formula, data, family = binomial)
plot(fit)
detach(sepsis)
Is there a way to customize the output of plot() in order to avoid overlapping of the terminal nodes?