Errors in running code in vignettes:
when running code in ‘ctree.Rnw’
  ...

> options(width = 70, SweaveHooks = list(leftpar = function() par(mai = par("mai") * 
+     c(1, 1.1, 1, 1))))

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

> require("coin")
Loading required package: coin
Loading required package: survival

> require("strucchange")
Loading required package: 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

> require("coin")

> require("Formula")
Loading required package: Formula

> require("survival")

> require("sandwich")

> set.seed(290875)

> ctree_control(teststat = "max")
$criterion
[1] "p.value"

$logmincriterion
[1] -0.05129329

$minsplit
[1] 20

$minbucket
[1] 7

$minprob
[1] 0.01

$stump
[1] FALSE

$nmax
 yx   z 
Inf Inf 

$lookahead
[1] FALSE

$mtry
[1] Inf

$maxdepth
[1] Inf

$multiway
[1] FALSE

$splittry
[1] 2

$maxsurrogate
[1] 0

$numsurrogate
[1] FALSE

$majority
[1] FALSE

$caseweights
[1] TRUE

$applyfun
function (X, FUN, ...) 
{
    FUN <- match.fun(FUN)
    if (!is.vector(X) || is.object(X)) 
        X <- as.list(X)
    .Internal(lapply(X, FUN))
}
<bytecode: 0x56086bc73e78>
<environment: namespace:base>

$saveinfo
[1] TRUE

$bonferroni
[1] TRUE

$update
NULL

$selectfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .select(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778b628>
<environment: 0x56087778aa58>

$splitfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .split(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778f900>
<environment: 0x56087778ed30>

$svselectfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .select(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778b628>
<environment: 0x56087778ec50>

$svsplitfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .split(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778f900>
<environment: 0x56087778eb00>

$teststat
[1] "maximum"

$splitstat
[1] "quadratic"

$splittest
[1] FALSE

$pargs
$maxpts
[1] 25000

$abseps
[1] 0.001

$releps
[1] 0

attr(,"class")
[1] "GenzBretz"

$testtype
[1] "Bonferroni"

$nresample
[1] 9999

$tol
[1] 1.490116e-08

$intersplit
[1] FALSE

$MIA
[1] FALSE


> ctree_control(teststat = "quad")
$criterion
[1] "p.value"

$logmincriterion
[1] -0.05129329

$minsplit
[1] 20

$minbucket
[1] 7

$minprob
[1] 0.01

$stump
[1] FALSE

$nmax
 yx   z 
Inf Inf 

$lookahead
[1] FALSE

$mtry
[1] Inf

$maxdepth
[1] Inf

$multiway
[1] FALSE

$splittry
[1] 2

$maxsurrogate
[1] 0

$numsurrogate
[1] FALSE

$majority
[1] FALSE

$caseweights
[1] TRUE

$applyfun
function (X, FUN, ...) 
{
    FUN <- match.fun(FUN)
    if (!is.vector(X) || is.object(X)) 
        X <- as.list(X)
    .Internal(lapply(X, FUN))
}
<bytecode: 0x56086bc73e78>
<environment: namespace:base>

$saveinfo
[1] TRUE

$bonferroni
[1] TRUE

$update
NULL

$selectfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .select(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778b628>
<environment: 0x5608777b37c8>

$splitfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .split(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778f900>
<environment: 0x5608777b7518>

$svselectfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .select(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778b628>
<environment: 0x5608777b7438>

$svsplitfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .split(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778f900>
<environment: 0x5608777b72e8>

$teststat
[1] "quadratic"

$splitstat
[1] "quadratic"

$splittest
[1] FALSE

$pargs
$maxpts
[1] 25000

$abseps
[1] 0.001

$releps
[1] 0

attr(,"class")
[1] "GenzBretz"

$testtype
[1] "Bonferroni"

$nresample
[1] 9999

$tol
[1] 1.490116e-08

$intersplit
[1] FALSE

$MIA
[1] FALSE


> ctree_control(testtype = "Bonferroni")
$criterion
[1] "p.value"

$logmincriterion
[1] -0.05129329

$minsplit
[1] 20

$minbucket
[1] 7

$minprob
[1] 0.01

$stump
[1] FALSE

$nmax
 yx   z 
Inf Inf 

$lookahead
[1] FALSE

$mtry
[1] Inf

$maxdepth
[1] Inf

$multiway
[1] FALSE

$splittry
[1] 2

$maxsurrogate
[1] 0

$numsurrogate
[1] FALSE

$majority
[1] FALSE

$caseweights
[1] TRUE

$applyfun
function (X, FUN, ...) 
{
    FUN <- match.fun(FUN)
    if (!is.vector(X) || is.object(X)) 
        X <- as.list(X)
    .Internal(lapply(X, FUN))
}
<bytecode: 0x56086bc73e78>
<environment: namespace:base>

$saveinfo
[1] TRUE

$bonferroni
[1] TRUE

$update
NULL

$selectfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .select(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778b628>
<environment: 0x5608777c8440>

$splitfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .split(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778f900>
<environment: 0x5608777c8360>

$svselectfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .select(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778b628>
<environment: 0x5608777c8280>

$svsplitfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .split(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778f900>
<environment: 0x5608777c8130>

$teststat
[1] "quadratic"

$splitstat
[1] "quadratic"

$splittest
[1] FALSE

$pargs
$maxpts
[1] 25000

$abseps
[1] 0.001

$releps
[1] 0

attr(,"class")
[1] "GenzBretz"

$testtype
[1] "Bonferroni"

$nresample
[1] 9999

$tol
[1] 1.490116e-08

$intersplit
[1] FALSE

$MIA
[1] FALSE


> ctree_control(minsplit = 20)
$criterion
[1] "p.value"

$logmincriterion
[1] -0.05129329

$minsplit
[1] 20

$minbucket
[1] 7

$minprob
[1] 0.01

$stump
[1] FALSE

$nmax
 yx   z 
Inf Inf 

$lookahead
[1] FALSE

$mtry
[1] Inf

$maxdepth
[1] Inf

$multiway
[1] FALSE

$splittry
[1] 2

$maxsurrogate
[1] 0

$numsurrogate
[1] FALSE

$majority
[1] FALSE

$caseweights
[1] TRUE

$applyfun
function (X, FUN, ...) 
{
    FUN <- match.fun(FUN)
    if (!is.vector(X) || is.object(X)) 
        X <- as.list(X)
    .Internal(lapply(X, FUN))
}
<bytecode: 0x56086bc73e78>
<environment: namespace:base>

$saveinfo
[1] TRUE

$bonferroni
[1] TRUE

$update
NULL

$selectfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .select(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778b628>
<environment: 0x5608777da5d8>

$splitfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .split(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778f900>
<environment: 0x5608777da4f8>

$svselectfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .select(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778b628>
<environment: 0x5608777da418>

$svsplitfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .split(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778f900>
<environment: 0x5608777da2c8>

$teststat
[1] "quadratic"

$splitstat
[1] "quadratic"

$splittest
[1] FALSE

$pargs
$maxpts
[1] 25000

$abseps
[1] 0.001

$releps
[1] 0

attr(,"class")
[1] "GenzBretz"

$testtype
[1] "Bonferroni"

$nresample
[1] 9999

$tol
[1] 1.490116e-08

$intersplit
[1] FALSE

$MIA
[1] FALSE


> ctree_control(maxsurrogate = 3)
$criterion
[1] "p.value"

$logmincriterion
[1] -0.05129329

$minsplit
[1] 20

$minbucket
[1] 7

$minprob
[1] 0.01

$stump
[1] FALSE

$nmax
 yx   z 
Inf Inf 

$lookahead
[1] FALSE

$mtry
[1] Inf

$maxdepth
[1] Inf

$multiway
[1] FALSE

$splittry
[1] 2

$maxsurrogate
[1] 3

$numsurrogate
[1] FALSE

$majority
[1] FALSE

$caseweights
[1] TRUE

$applyfun
function (X, FUN, ...) 
{
    FUN <- match.fun(FUN)
    if (!is.vector(X) || is.object(X)) 
        X <- as.list(X)
    .Internal(lapply(X, FUN))
}
<bytecode: 0x56086bc73e78>
<environment: namespace:base>

$saveinfo
[1] TRUE

$bonferroni
[1] TRUE

$update
NULL

$selectfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .select(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778b628>
<environment: 0x5608777ed1e0>

$splitfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .split(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778f900>
<environment: 0x5608777ed100>

$svselectfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .select(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778b628>
<environment: 0x5608777ed020>

$svsplitfun
function (model, trafo, data, subset, weights, whichvar, ctrl) 
{
    args <- list(...)
    ctrl[names(args)] <- args
    .split(model, trafo, data, subset, weights, whichvar, ctrl, 
        FUN = .ctree_test)
}
<bytecode: 0x56087778f900>
<environment: 0x5608777eced0>

$teststat
[1] "quadratic"

$splitstat
[1] "quadratic"

$splittest
[1] FALSE

$pargs
$maxpts
[1] 25000

$abseps
[1] 0.001

$releps
[1] 0

attr(,"class")
[1] "GenzBretz"

$testtype
[1] "Bonferroni"

$nresample
[1] 9999

$tol
[1] 1.490116e-08

$intersplit
[1] FALSE

$MIA
[1] FALSE


> ls <- data.frame(y = gl(3, 50, labels = c("A", "B", 
+     "C")), x1 = rnorm(150) + rep(c(1, 0, 0), c(50, 50, 50)), 
+     x2 = runif(150))

> library("partykit")

> ctree(y ~ x1 + x2, data = ls)

Model formula:
y ~ x1 + x2

Fitted party:
[1] root
|   [2] x1 <= 0.82552: C (n = 96, err = 57.3%)
|   [3] x1 > 0.82552: A (n = 54, err = 42.6%)

Number of inner nodes:    1
Number of terminal nodes: 2

> ct <- ctree(y ~ x1 + x2, data = ls)

> ct

Model formula:
y ~ x1 + x2

Fitted party:
[1] root
|   [2] x1 <= 0.82552: C (n = 96, err = 57.3%)
|   [3] x1 > 0.82552: A (n = 54, err = 42.6%)

Number of inner nodes:    1
Number of terminal nodes: 2

> plot(ct)

> ct[1]

Model formula:
y ~ x1 + x2

Fitted party:
[1] root
|   [2] x1 <= 0.82552: C (n = 96, err = 57.3%)
|   [3] x1 > 0.82552: A (n = 54, err = 42.6%)

Number of inner nodes:    1
Number of terminal nodes: 2

> class(ct[1])
[1] "constparty" "party"     

> predict(ct, newdata = ls)
  1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17 
  A   A   A   A   C   A   C   A   C   C   A   A   C   A   A   A   A 
 18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34 
  C   A   C   A   A   A   C   A   A   A   C   C   A   A   C   A   A 
 35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51 
  C   A   A   C   C   C   A   A   C   C   C   C   A   A   A   A   A 
 52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67  68 
  A   C   C   C   C   A   C   C   A   C   C   C   C   C   C   A   A 
 69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85 
  A   A   A   C   C   A   C   A   C   C   C   C   C   C   C   C   C 
 86  87  88  89  90  91  92  93  94  95  96  97  98  99 100 101 102 
  C   C   C   A   C   A   C   A   C   C   C   C   C   C   C   C   A 
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 
  C   C   C   A   C   C   A   C   C   C   C   C   C   C   A   C   C 
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 
  C   C   C   C   C   C   C   C   C   C   C   C   C   C   C   C   C 
137 138 139 140 141 142 143 144 145 146 147 148 149 150 
  C   A   C   C   C   C   A   C   C   A   C   A   C   A 
Levels: A B C

> predict(ct, newdata = ls[c(1, 51, 101), ], type = "prob")
            A         B         C
1   0.5740741 0.2592593 0.1666667
51  0.5740741 0.2592593 0.1666667
101 0.1979167 0.3750000 0.4270833

> predict(ct, newdata = ls[c(1, 51, 101), ], type = "node")
  1  51 101 
  3   3   2 

> library("strucchange")

> sctest(ct)

  When sourcing ‘ctree.R’:
Error: no applicable method for ‘estfun’ applied to an object of class "c('constparty', 'party')"
Execution halted
when running code in ‘mob.Rnw’
  ...

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

> 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)

  When sourcing 'mob.R':
Error: no applicable method for ‘estfun’ applied to an object of class "c('modelparty', 'party')"
Execution halted