DavisVaughan / furrr

Apply Mapping Functions in Parallel using Futures
https://furrr.futureverse.org/
Other
695 stars 39 forks source link

furrr::future_map could not find function #245

Closed 13479776 closed 2 years ago

13479776 commented 2 years ago

Hi, guys,

I used the furrr::future_map for list data processing. The error was happened that a function named mf could not be found, although m and mf function have been loaded in the R environments (I enter the m or mf into console, and the code can be shown)

require(furrr)
    future::plan(multisession, workers = 2)
msScore <- furrr::future_map(x, m, .options = furrr_options(pseed = 123))

Error in m(..  : 
  could not find function "mf"
Called from: signalConditions(obj, exclude = getOption("future.relay.immediate", 
    "immediateCondition"), resignal = resignal, ...)

Could you please give some suggestion? if i use the purrr::map, the problems was missing.

Thanks

hees

DavisVaughan commented 2 years ago

Could you please turn this into a self-contained reprex (short for minimal reproducible example)? It will help us help you if we can be sure we're all working with/looking at the same stuff.

If you've never heard of a reprex before, you might want to start by reading the tidyverse.org help page.

You can install reprex by running (you may already have it, though, if you have the tidyverse package installed):

install.packages("reprex")

Thanks

13479776 commented 2 years ago

Hi DavisVaughan,

 I use the reprex to trace the code. The reprex could not process the developing package under devtools. so, I built the package and found the problems were missing. I guess the furrr require the package have been built and installed in the R. Is it right?

thanks

Hees

DavisVaughan commented 2 years ago

Yea you need to install the package you are developing for it to be available on other workers and for furrr to be able to find functions from it