Running examples in ‘partykit-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: glmtree
> ### Title: Generalized Linear Model Trees
> ### Aliases: glmtree plot.glmtree predict.glmtree print.glmtree
> ### Keywords: tree
> 
> ### ** Examples
> 
> if(require("mlbench")) {
+ 
+ ## Pima Indians diabetes data
+ data("PimaIndiansDiabetes", package = "mlbench")
+ 
+ ## recursive partitioning of a logistic regression model
+ pid_tree2 <- glmtree(diabetes ~ glucose | pregnant +
+   pressure + triceps + insulin + mass + pedigree + age,
+   data = PimaIndiansDiabetes, family = binomial)
+ 
+ ## printing whole tree or individual nodes
+ print(pid_tree2)
+ print(pid_tree2, node = 1)
+ 
+ ## visualization
+ plot(pid_tree2)
+ plot(pid_tree2, tp_args = list(cdplot = TRUE))
+ plot(pid_tree2, terminal_panel = NULL)
+ 
+ ## estimated parameters
+ coef(pid_tree2)
+ coef(pid_tree2, node = 5)
+ summary(pid_tree2, node = 5)
+ 
+ ## deviance, log-likelihood and information criteria
+ deviance(pid_tree2)
+ logLik(pid_tree2)
+ AIC(pid_tree2)
+ BIC(pid_tree2)
+ 
+ ## different types of predictions
+ pid <- head(PimaIndiansDiabetes)
+ predict(pid_tree2, newdata = pid, type = "node")
+ predict(pid_tree2, newdata = pid, type = "response")
+ predict(pid_tree2, newdata = pid, type = "link")
+ 
+ }
Loading required package: mlbench
Generalized linear model tree (family: binomial)

Model formula:
diabetes ~ glucose | pregnant + pressure + triceps + insulin + 
    mass + pedigree + age

Fitted party:
[1] root
|   [2] mass <= 26.3: n = 167
|       (Intercept)     glucose 
|       -9.95150963  0.05870786 
|   [3] mass > 26.3
|   |   [4] age <= 30: n = 304
|   |       (Intercept)     glucose 
|   |       -6.70558554  0.04683748 
|   |   [5] age > 30: n = 297
|   |       (Intercept)     glucose 
|   |       -2.77095386  0.02353582 

Number of inner nodes:    2
Number of terminal nodes: 3
Number of parameters per node: 2
Objective function (negative log-likelihood): 355.4578
Generalized linear model tree (family: binomial) 
-- Node 1 --

Estimated parameters:
(Intercept)     glucose 
-5.35008039  0.03787304 

Objective function:
404.3598

Parameter instability tests:
              pregnant  pressure    triceps   insulin         mass    pedigree
statistic 2.988542e+01 7.5024235 15.9409542 6.5969297 4.880982e+01 18.33476114
p.value   9.778517e-05 0.9104325  0.0647362 0.9701412 8.316815e-09  0.02252955
                   age
statistic 4.351412e+01
p.value   1.182811e-07
Loading required namespace: vcd
Failed with error:  ‘there is no package called ‘vcd’’
Error in terminal_panel(list(node = list(id = 1L, split = list(varid = 7L,  : 
  Package ‘vcd’ is required for spine/CD plots
Calls: plot ... plot.modelparty -> plot.party -> do.call -> terminal_panel
Execution halted