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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: chunk
> ### Title: Chunk Jobs for Sequential Execution
> ### Aliases: chunk lpt binpack
> 
> ### ** Examples
> 
> ## Don't show: 
>  batchtools:::example_push_temp(2) 
> ## End(Don't show)
> ch = chunk(1:10, n.chunks = 2)
> table(ch)
ch
1 2 
5 5 
> 
> ch = chunk(rep(1, 10), chunk.size = 2)
> table(ch)
ch
1 2 3 4 5 
2 2 2 2 2 
> 
> set.seed(1)
> x = runif(10)
> ch = lpt(x, n.chunks = 2)
> sapply(split(x, ch), sum)
       1        2 
2.808393 2.706746 
> 
> set.seed(1)
> x = runif(10)
> ch = binpack(x, 1)
> sapply(split(x, ch), sum)
        1         2         3         4         5         6 
0.9446753 0.9699941 0.8983897 0.9263065 0.8307960 0.9449773 
> 
> # Job chunking
> tmp = makeRegistry(file.dir = NA, make.default = FALSE)
No readable configuration file found
Created registry in '/tmp/RtmpWVvbrE/registry307ef74d8e4fa1' using cluster functions 'Interactive'
> ids = batchMap(identity, 1:25, reg = tmp)
Adding 25 jobs ...
> 
> ### Group into chunks with 10 jobs each
> library(data.table)

Attaching package: ‘data.table’

The following object is masked from ‘package:base’:

    %notin%

> ids[, chunk := chunk(job.id, chunk.size = 10)]
> print(ids[, .N, by = chunk])
   chunk     N
   <int> <int>
1:     3     8
2:     1     9
3:     2     8
> 
> ### Group into 4 chunks
> ids[, chunk := chunk(job.id, n.chunks = 4)]
> print(ids[, .N, by = chunk])
   chunk     N
   <int> <int>
1:     2     6
2:     3     6
3:     4     6
4:     1     7
> 
> ### Submit to batch system
> submitJobs(ids = ids, reg = tmp)
Submitting 25 jobs in 4 chunks using cluster functions 'Interactive' ...
> 
> # Grouped chunking
> tmp = makeExperimentRegistry(file.dir = NA, make.default = FALSE)
No readable configuration file found
Created registry in '/tmp/RtmpWVvbrE/registry307ef72ddc385e' using cluster functions 'Interactive'
> prob = addProblem(reg = tmp, "prob1", data = iris, fun = function(job, data) nrow(data))
Adding problem 'prob1'
> prob = addProblem(reg = tmp, "prob2", data = Titanic, fun = function(job, data) nrow(data))
Adding problem 'prob2'
> algo = addAlgorithm(reg = tmp, "algo", fun = function(job, data, instance, i, ...) problem)
Adding algorithm 'algo'
> prob.designs = list(prob1 = data.table(), prob2 = data.table(x = 1:2))
> algo.designs = list(algo = data.table(i = 1:3))
> addExperiments(prob.designs, algo.designs, repls = 3, reg = tmp)
Adding 9 experiments ('prob1'[1] x 'algo'[3] x repls[3]) ...
Adding 18 experiments ('prob2'[2] x 'algo'[3] x repls[3]) ...
> 
> ### Group into chunks of 5 jobs, but do not put multiple problems into the same chunk
> # -> only one problem has to be loaded per chunk, and only once because it is cached
> ids = getJobTable(reg = tmp)[, .(job.id, problem, algorithm)]
> ids[, chunk := chunk(job.id, chunk.size = 5), by = "problem"]
Error in `[.data.table`(ids, , `:=`(chunk, chunk(job.id, chunk.size = 5)),  : 
  attempt access index 3/3 in VECTOR_ELT
Calls: [ -> [.data.table
Execution halted