I am using R's excellent future package. And in the documentation it mentions %global%
and %packages%
for assigning global variables and packages to be evaluated in the future environment. But those seem to only work with %<-%
.
My question is: is there away to do that with future_apply
as well. I tried
x = 1
future.apply::future_sapply(1:50, function(y) {
glue("{x}")
}) %packages% "glue" %globals% "x"
and It doesn't work