Errors in running code in vignettes:
when running code in 'mob.Rnw'
  ...

> suppressWarnings(RNGversion("3.5.2"))

> library("partykit")
Loading required package: grid
Loading required package: libcoin
Loading required package: mvtnorm

> options(prompt = "R> ", continue = "+  ", digits = 4, 
+     useFancyQuotes = FALSE)

> data("PimaIndiansDiabetes", package = "mlbench")

> pid_formula <- diabetes ~ glucose | pregnant + pressure + 
+     triceps + insulin + mass + pedigree + age

> logit <- function(y, x, start = NULL, weights = NULL, 
+     offset = NULL, ...) {
+     glm(y ~ 0 + x, family = binomial, start = start, ...)
+ }

> pid_tree <- mob(pid_formula, data = PimaIndiansDiabetes, 
+     fit = logit)

> pid_tree
Model-based recursive partitioning (logit)

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

Fitted party:
[1] root
|   [2] mass <= 26.3: n = 167
|       x(Intercept)     xglucose 
|           -9.95151      0.05871 
|   [3] mass > 26.3
|   |   [4] age <= 30: n = 304
|   |       x(Intercept)     xglucose 
|   |           -6.70559      0.04684 
|   |   [5] age > 30: n = 297
|   |       x(Intercept)     xglucose 
|   |           -2.77095      0.02354 

Number of inner nodes:    2
Number of terminal nodes: 3
Number of parameters per node: 2
Objective function: 355.5

> pid_tree2 <- glmtree(diabetes ~ glucose | pregnant + 
+     pressure + triceps + insulin + mass + pedigree + age, data = PimaIndiansDiabetes, 
+     .... [TRUNCATED] 

> plot(pid_tree)

> plot(pid_tree2, tp_args = list(ylines = 1, margins = c(1.5, 
+     1.5, 1.5, 2.5)))
Loading required namespace: vcd

> library("strucchange")
Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

Loading required package: sandwich

> sctest(pid_tree, node = 1)
           pregnant pressure  triceps insulin      mass pedigree       age
statistic 2.989e+01   7.5024 15.94095  6.5969 4.881e+01 18.33476 4.351e+01
p.value   9.779e-05   0.9104  0.06474  0.9701 8.317e-09  0.02253 1.183e-07

> sctest(pid_tree, node = 2)
          pregnant pressure triceps insulin    mass pedigree    age
statistic  10.3924   4.3537  5.9112   3.786 10.4749    3.626 6.0979
p.value     0.4903   0.9998  0.9869   1.000  0.4785    1.000 0.9818

> sctest(pid_tree, node = 3)
           pregnant pressure triceps insulin   mass pedigree       age
statistic 2.674e+01   6.1758  7.3468   7.896 9.1546 17.96439 3.498e+01
p.value   4.434e-04   0.9845  0.9226   0.870 0.7033  0.02647 8.099e-06

> names(pid_tree$info)
[1] "call"    "formula" "Formula" "terms"   "fit"     "control" "dots"   
[8] "nreg"   

> names(pid_tree$node$info)
[1] "coefficients" "objfun"       "object"       "nobs"         "p.value"     
[6] "test"        

> print(pid_tree, node = 3)
Model-based recursive partitioning (logit) 
-- Node 3 --

Estimated parameters:
x(Intercept)     xglucose 
    -4.61015      0.03426 

Objective function:
344.2

Parameter instability tests:
           pregnant pressure triceps insulin   mass pedigree       age
statistic 2.674e+01   6.1758  7.3468   7.896 9.1546 17.96439 3.498e+01
p.value   4.434e-04   0.9845  0.9226   0.870 0.7033  0.02647 8.099e-06

> coef(pid_tree)
  x(Intercept) xglucose
2       -9.952  0.05871
4       -6.706  0.04684
5       -2.771  0.02354

> coef(pid_tree, node = 1)
x(Intercept)     xglucose 
    -5.35008      0.03787 

> summary(pid_tree, node = 1)

Call:
glm(formula = y ~ 0 + x, family = binomial, start = start)

Deviance Residuals: 
   Min      1Q  Median      3Q     Max  
-2.110  -0.784  -0.536   0.857   3.273  

Coefficients:
             Estimate Std. Error z value Pr(>|z|)    
x(Intercept) -5.35008    0.42083   -12.7   <2e-16 ***
xglucose      0.03787    0.00325    11.7   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 1064.67  on 768  degrees of freedom
Residual deviance:  808.72  on 766  degrees of freedom
AIC: 812.7

Number of Fisher Scoring iterations: 4


> exp(coef(pid_tree)[, 2])
    2     4     5 
1.060 1.048 1.024 

> risk <- round(100 * (exp(coef(pid_tree)[, 2]) - 1), 
+     digits = 1)

> logLik(pid_tree)
'log Lik.' -355.5 (df=8)

> AIC(pid_tree)
[1] 726.9

> BIC(pid_tree)
[1] 764.1

> mean(residuals(pid_tree)^2)
[1] 0.9257

> deviance(pid_tree)/sum(weights(pid_tree))
[1] 0.9257

> deviance(pid_tree)/nobs(pid_tree)
[1] 0.9257

> pid <- head(PimaIndiansDiabetes)

> predict(pid_tree, newdata = pid, type = "node")
1 2 3 4 5 6 
5 5 2 4 5 2 

> width(pid_tree)
[1] 3

> depth(pid_tree)
[1] 2

> pid_tree[3]
Model-based recursive partitioning (logit)

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

Fitted party:
[3] root
|   [4] age <= 30: n = 304
|       x(Intercept)     xglucose 
|           -6.70559      0.04684 
|   [5] age > 30: n = 297
|       x(Intercept)     xglucose 
|           -2.77095      0.02354 

Number of inner nodes:    1
Number of terminal nodes: 2
Number of parameters per node: 2
Objective function: 325.2

> predict(pid_tree2, newdata = pid, type = "node")
1 2 3 4 5 6 
5 5 2 4 5 2 

> predict(pid_tree2, newdata = pid, type = "response")
      1       2       3       4       5       6 
0.67092 0.31639 0.68827 0.07330 0.61146 0.04143 

> predict(pid_tree2, newdata = pid, type = "link")
      1       2       3       4       5       6 
 0.7123 -0.7704  0.7920 -2.5371  0.4535 -3.1414 

> data("Journals", package = "AER")

  When sourcing 'mob.R':
Error: there is no package called 'AER'
Execution halted

  'constparty.Rnw'... [12s/12s] OK
  'ctree.Rnw' using 'UTF-8'... [12s/13s] OK
  'mob.Rnw'... failed
  'partykit.Rnw'... [3s/4s] OK