Closed abdellah19jan closed 2 years ago
You can't do something like this with furrr or future in general. future_map_dbl()
might be running in a completely different R process than the one where gv
originally exists, so there is generally no way for it to update it because it won't have access to the original value. The globals package will probably send a copy of gv
over to the worker process, and <<-
will be updating that copy at each iteration, but the original version of gv
will be left untouched.
Hello,
I'm trying to increment a counter inside a function which is invoked by future_map, it does work with map but not with future_map, see code bellow.
I do believe that is related to globals, but I don't see how to fix it.
Thanks in advance for your help!