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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: trafotree
> ### Title: Transformation Trees
> ### Aliases: trafotree predict.trafotree logLik.trafotree
> ### Keywords: trees
> 
> ### ** Examples
> 
> 
> ### Example: Stratified Medicine Using Partitioned Cox-Models
> ### A combination of <DOI:10.1515/ijb-2015-0032> and <arXiv:1701.02110>
> ### based on infrastructure in the mlt R add-on package described in
> ### https://cran.r-project.org/web/packages/mlt.docreg/vignettes/mlt.pdf
> 
> library("trtf")
> library("survival")
> ### German Breast Cancer Study Group 2 data set
> data("GBSG2", package = "TH.data")
> 
> ### set-up Cox model with overall treatment effect in hormonal therapy
> yvar <- numeric_var("y", support = c(100, 2000), bounds = c(0, Inf))
> By <- Bernstein_basis(yvar, order = 5, ui = "incre")
> m <- ctm(response = By, shifting = ~ horTh, todistr = "MinExt", data = GBSG2)
> GBSG2$y <- with(GBSG2, Surv(time, cens))
> 
> ### overall log-hazard ratio
> coef(cmod <- mlt(m, data = GBSG2))["horThyes"]
  horThyes 
-0.3699338 
> ### roughly the same as 
> coef(coxph(y ~ horTh, data = GBSG2))
  horThyes 
-0.3640099 
> 
> ### partition the model, ie both the baseline hazard function AND the
> ### treatment effect
> (part_cmod <- trafotree(m, formula = y ~ horTh | age + menostat + tsize + 
+     tgrade + pnodes + progrec + estrec, data = GBSG2))

Model formula:
y ~ horTh + (age + menostat + tsize + tgrade + pnodes + progrec + 
    estrec)

Fitted party:
[1] root
|   [2] pnodes <= 4: 2372.000 (n = 433)
|   [3] pnodes > 4
|   |   [4] tgrade <= II: 1146.000 (n = 179)
|   |   [5] tgrade > II: 600.000 (n = 74)

Number of inner nodes:    2
Number of terminal nodes: 3
> 
> ### compare the log-likelihoods
> logLik(cmod)
'log Lik.' -2614.149 (df=7)
> logLik(part_cmod)
'log Lik.' -2569.702 (df=21)
> 
> ### stronger effects in nodes 2 and 4 and no effect in node 5
> coef(part_cmod)[, "horThyes"]
         2          4          5 
-0.4899136 -0.4617555  0.0825347 
> 
> ### plot the conditional survivor functions; blue is untreated
> ### and green is hormonal therapy
> nd <- data.frame(horTh = sort(unique(GBSG2$horTh)))
> plot(part_cmod, newdata = nd, 
+      tp_args = list(type = "survivor", col = c("cadetblue3", "chartreuse4")))
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