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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: palmtree
> ### Title: Partially Additive (Generalized) Linear Model Trees
> ### Aliases: palmtree print.palmtree plot.palmtree coef.palmtree
> ###   logLik.palmtree predict.palmtree
> ### Keywords: tree
> 
> ### ** Examples
> 
> ## one DGP from Sies and Van Mechelen (2015)
> dgp <- function(nobs = 1000, nreg = 5, creg = 0.4, ptreat = 0.5, sd = 1,
+   coef = c(1, 0.25, 0.25, 0, 0, -0.25), eff = 1)
+ {
+   d <- mvtnorm::rmvnorm(nobs,
+     mean = rep(0, nreg),
+     sigma = diag(1 - creg, nreg) + creg)
+   colnames(d) <- paste0("x", 1:nreg)
+   d <- as.data.frame(d)
+   d$a <- rbinom(nobs, size = 1, prob = ptreat)
+   d$err <- rnorm(nobs, mean = 0, sd = sd)
+ 
+   gopt <- function(d) {
+     as.numeric(d$x1 > -0.545) * as.numeric(d$x2 < 0.545)
+   }
+   d$y <- coef[1] + drop(as.matrix(d[, paste0("x", 1:5)]) %*% coef[-1]) -
+     eff * (d$a - gopt(d))^2 + d$err
+   d$a <- factor(d$a)
+   return(d)
+ }
> set.seed(1)
> d <- dgp()
> 
> ## estimate PALM tree with correctly specified global (partially
> ## additive) regressors and all variables considered for partitioning
> palm <- palmtree(y ~ a | x1 + x2 + x5 | x1 + x2 + x3 + x4 + x5, data = d)
> print(palm)
Partially additive linear model tree

Model formula:
y ~ a | x1 + x2 + x3 + x4 + x5

Fitted party:
[1] root
|   [2] x2 <= 0.55633
|   |   [3] x1 <= -0.5168: n = 271
|   |       (Intercept)          a1 
|   |         0.7604183  -0.8261878 
|   |   [4] x1 > -0.5168: n = 427
|   |       (Intercept)          a1 
|   |        0.01690781  0.97105223 
|   [5] x2 > 0.55633: n = 302
|       (Intercept)          a1 
|          1.158455   -1.085478 

Number of inner nodes:    2
Number of terminal nodes: 3
Number of parameters per node: 2
Objective function (residual sum of squares): 1063.744

Linear fixed effects (from palm model):
        x1         x2         x5 
 0.1997235  0.1888170 -0.2940163 
> plot(palm)
Error in unit(1, "strwidth", split) : 
  no string supplied for 'strwidth/height' unit
Calls: plot ... edge_panel -> grid.rect -> rectGrob -> is.unit -> unit
Execution halted