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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: TuningInstanceSingleCrit
> ### Title: Single Criterion Tuning Instance
> ### Aliases: TuningInstanceSingleCrit
> 
> ### ** Examples
> 
> library(data.table)
> library(paradox)
> library(mlr3)
> 
> # Objects required to define the performance evaluator:
> task = tsk("iris")
> learner = lrn("classif.rpart")
> resampling = rsmp("holdout")
> measure = msr("classif.ce")
> param_set = ParamSet$new(list(
+   ParamDbl$new("cp", lower = 0.001, upper = 0.1),
+   ParamInt$new("minsplit", lower = 1, upper = 10))
+ )
> 
> terminator = trm("evals", n_evals = 5)
> inst = TuningInstanceSingleCrit$new(
+   task = task,
+   learner = learner,
+   resampling = resampling,
+   measure = measure,
+   search_space = param_set,
+   terminator = terminator
+ )
> 
> # first 4 points as cross product
> design = CJ(cp = c(0.05, 0.01), minsplit = c(5, 3))
> inst$eval_batch(design)
INFO  [23:23:55.531] [bbotk] Evaluating 4 configuration(s) 
INFO  [23:23:55.669] [mlr3]  Benchmark with 4 resampling iterations 
INFO  [23:23:55.682] [mlr3]  Applying learner 'classif.rpart' on task 'iris' (iter 1/1) 
INFO  [23:23:55.707] [mlr3]  Applying learner 'classif.rpart' on task 'iris' (iter 1/1) 
INFO  [23:23:55.730] [mlr3]  Applying learner 'classif.rpart' on task 'iris' (iter 1/1) 
INFO  [23:23:55.758] [mlr3]  Applying learner 'classif.rpart' on task 'iris' (iter 1/1) 
INFO  [23:23:55.787] [mlr3]  Finished benchmark 
INFO  [23:23:55.976] [bbotk] Result of batch 1: 
INFO  [23:23:55.979] [bbotk]    cp minsplit classif.ce                                uhash 
INFO  [23:23:55.979] [bbotk]  0.01        3       0.04 8c142e3b-015d-4243-bfdd-94fa313ea319 
INFO  [23:23:55.979] [bbotk]  0.01        5       0.04 23e0922a-ead1-4d72-8d5c-7783f1b8f838 
INFO  [23:23:55.979] [bbotk]  0.05        3       0.04 d87e393c-259a-444f-a51e-f36277085ef8 
INFO  [23:23:55.979] [bbotk]  0.05        5       0.04 f89922f5-517a-4e29-a177-478e6466cb63 
> inst$archive
<ArchiveTuning>
     cp minsplit classif.ce                                uhash  x_domain
1: 0.01        3       0.04 8c142e3b-015d-4243-bfdd-94fa313ea319 <list[2]>
2: 0.01        5       0.04 23e0922a-ead1-4d72-8d5c-7783f1b8f838 <list[2]>
3: 0.05        3       0.04 d87e393c-259a-444f-a51e-f36277085ef8 <list[2]>
4: 0.05        5       0.04 f89922f5-517a-4e29-a177-478e6466cb63 <list[2]>
             timestamp batch_nr
1: 2021-01-24 23:23:55        1
2: 2021-01-24 23:23:55        1
3: 2021-01-24 23:23:55        1
4: 2021-01-24 23:23:55        1
> 
> # try more points, catch the raised terminated message
> tryCatch(
+   inst$eval_batch(data.table(cp = 0.01, minsplit = 7)),
+   terminated_error = function(e) message(as.character(e))
+ )
INFO  [23:23:55.983] [bbotk] Evaluating 1 configuration(s) 
INFO  [23:23:56.033] [mlr3]  Benchmark with 1 resampling iterations 
INFO  [23:23:56.061] [mlr3]  Applying learner 'classif.rpart' on task 'iris' (iter 1/1) 
INFO  [23:23:56.117] [mlr3]  Finished benchmark 
INFO  [23:23:56.198] [bbotk] Result of batch 2: 
INFO  [23:23:56.201] [bbotk]    cp minsplit classif.ce                                uhash 
INFO  [23:23:56.201] [bbotk]  0.01        7       0.04 e71678d5-29ce-4277-8637-ac41cacdad1e 
> 
> # try another point although the budget is now exhausted
> # -> no extra evaluations
> tryCatch(
+   inst$eval_batch(data.table(cp = 0.01, minsplit = 9)),
+   terminated_error = function(e) message(as.character(e))
+ )
Error: Objective (obj:classif.rpart_on_iris, term:<TerminatorEvals>) terminated

> 
> inst$archive
<ArchiveTuning>
     cp minsplit classif.ce                                uhash  x_domain
1: 0.01        3       0.04 8c142e3b-015d-4243-bfdd-94fa313ea319 <list[2]>
2: 0.01        5       0.04 23e0922a-ead1-4d72-8d5c-7783f1b8f838 <list[2]>
3: 0.05        3       0.04 d87e393c-259a-444f-a51e-f36277085ef8 <list[2]>
4: 0.05        5       0.04 f89922f5-517a-4e29-a177-478e6466cb63 <list[2]>
5: 0.01        7       0.04 e71678d5-29ce-4277-8637-ac41cacdad1e <list[2]>
             timestamp batch_nr
1: 2021-01-24 23:23:55        1
2: 2021-01-24 23:23:55        1
3: 2021-01-24 23:23:55        1
4: 2021-01-24 23:23:55        1
5: 2021-01-24 23:23:56        2
> 
> ### Error handling
> # get a learner which breaks with 50% probability
> # set encapsulation + fallback
> learner = lrn("classif.debug", error_train = 0.5)
> learner$encapsulate = c(train = "evaluate", predict = "evaluate")
> learner$fallback = lrn("classif.featureless")
> 
> param_set = ParamSet$new(list(
+   ParamDbl$new("x", lower = 0, upper = 1)
+ ))
> 
> inst = TuningInstanceSingleCrit$new(
+   task = tsk("wine"),
+   learner = learner,
+   resampling = rsmp("cv", folds = 3),
+   measure = msr("classif.ce"),
+   search_space = param_set,
+   terminator = trm("evals", n_evals = 5)
+ )
> 
> tryCatch(
+   inst$eval_batch(data.table(x = 1:5 / 5)),
+   terminated_error = function(e) message(as.character(e))
+ )
INFO  [23:23:56.387] [bbotk] Evaluating 5 configuration(s) 
INFO  [23:23:56.624] [mlr3]  Benchmark with 15 resampling iterations 
INFO  [23:23:56.674] [mlr3]  Applying learner 'classif.debug' on task 'wine' (iter 2/3) 
INFO  [23:23:56.745] [mlr3]  Applying learner 'classif.debug' on task 'wine' (iter 1/3) 
INFO  [23:23:56.818] [mlr3]  Applying learner 'classif.debug' on task 'wine' (iter 2/3) 
INFO  [23:23:56.861] [mlr3]  Applying learner 'classif.debug' on task 'wine' (iter 3/3) 
INFO  [23:23:56.901] [mlr3]  Applying learner 'classif.debug' on task 'wine' (iter 1/3) 
INFO  [23:23:56.942] [mlr3]  Applying learner 'classif.debug' on task 'wine' (iter 3/3) 
INFO  [23:23:56.991] [mlr3]  Applying learner 'classif.debug' on task 'wine' (iter 1/3) 
INFO  [23:23:57.028] [mlr3]  Applying learner 'classif.debug' on task 'wine' (iter 1/3) 
INFO  [23:23:57.116] [mlr3]  Applying learner 'classif.debug' on task 'wine' (iter 2/3) 
INFO  [23:23:57.193] [mlr3]  Applying learner 'classif.debug' on task 'wine' (iter 2/3) 
INFO  [23:23:57.283] [mlr3]  Applying learner 'classif.debug' on task 'wine' (iter 3/3) 
INFO  [23:23:57.369] [mlr3]  Applying learner 'classif.debug' on task 'wine' (iter 3/3) 
INFO  [23:23:57.441] [mlr3]  Applying learner 'classif.debug' on task 'wine' (iter 1/3) 
INFO  [23:23:57.530] [mlr3]  Applying learner 'classif.debug' on task 'wine' (iter 2/3) 
INFO  [23:23:57.624] [mlr3]  Applying learner 'classif.debug' on task 'wine' (iter 3/3) 
INFO  [23:23:57.701] [mlr3]  Finished benchmark 
INFO  [23:23:58.314] [bbotk] Result of batch 1: 
INFO  [23:23:58.316] [bbotk]    x classif.ce                                uhash 
INFO  [23:23:58.316] [bbotk]  0.2  0.6179849 5faa0600-dfa7-4776-9cee-3e2ee1c21c16 
INFO  [23:23:58.316] [bbotk]  0.4  0.6179849 a6feb62f-b8a7-4fb7-b2e5-e52056df7a43 
INFO  [23:23:58.316] [bbotk]  0.6  0.6575330 e970cb62-3f4d-4dd7-af79-070ccd8204b2 
INFO  [23:23:58.316] [bbotk]  0.8  0.6682674 e590f4ba-5419-4ad5-bc06-b71f06125bc1 
INFO  [23:23:58.316] [bbotk]  1.0  0.6179849 e126527a-d3c9-4cc9-9b41-7bf760517818 
> 
> archive = inst$archive$data()
Error: attempt to apply non-function
Execution halted