Open CrossD opened 4 years ago
Thank you for reporting. I can reproduce this, also with "plain" futures, e.g.
library(future)
plan(cluster, workers = 1L)
VAR <- 1
f <- future({ f <- function(VAR=500) { print(VAR) }; f(VAR) })
value(f)
## Error in print(VAR) : object 'VAR' not found
This is a problem with the globals package; I've created https://github.com/HenrikBengtsson/globals/issues/53 to track and solve it over there. I'll try to remember to report back here the day it is fixed.
Just an update: I thought I fixed this in globals 1.14.0 released yesterday but I forgot to actually validate it here. It turns out that I didn't fix it completely so it still doesn't work with foreach. Now tracking this in https://github.com/HenrikBengtsson/globals/issues/71.
Good to know. I will follow the issue under globals. Thanks!
doFuture
fails to export the variableVAR
when the it coinsides with a function argument name. The sessioninfo is appended.However, the following works: