3
I need to execute a function that is in . Globalenv in a parallel processing using the multidplyr package.
Using a simple example without parallel processing, it works as expected:
library(dplyr)
library(purrr)
library(multidplyr)
data.frame(x = 1:10) %>%
mutate(y = purrr::map(x, add_a))
But when I try to put the parallelism, it does not recognize the function "add_a"
add_a <- function(x) {
paste0(x, "A")
}
data.frame(x = 1:10) %>%
partition() %>%
mutate(
y = purrr::map(x, add_a)
)
Returning the following message:
Error in checkForRemoteErrors(lapply(cl, recvResult)) :
10 nodes produced errors; first error: objeto 'add_a' não encontrado
Dear @Italo Cegatta, this link might help you: https://github.com/hadley/multidplyr/issues/15
– fsbmat