I have a function that uses rbindlist, and I would like to call this function using parLapply. Simplified version below:
func <- function(x){
df1 <- data.frame(a = c(x,2), b = c(3,4))
df2 <- data.frame(a = c(x,2), b = c(4,4))
rbindlist(list(df1,df2))
}
cl <- makeCluster(getOption('cl.cores', detectCores()))
tmp <- parLapply(cl,c(1,2),func)
stopCluster(cl)
However, I get the error message:
Error in checkForRemoteErrors (val): 2 nodes caused errors; first error: could not find function "rbindlist"
source
share