Closed HenrikBengtsson closed 5 years ago
A small reproducible example:
library("doFuture")
registerDoFuture()
a <- 42
b <- 21
X <- list(function(b) 2 * a, function() b / 2, function() a + b, function() 3.14)
plan(sequential)
y <- foreach(f = X) %dopar% f()
str(y)
List of 4
$ : num 84
$ : num 10.5
$ : num 63
$ : num 3.14
plan(multisession, workers = 2L)
y <- foreach(f = X) %dopar% f()
## Error in { : task 1 failed - "object 'a' not found"
As in future.apply, cf. Issue https://github.com/HenrikBengtsson/future.apply/issues/12