I am currently developing an R package and would like to make use of parallelization with the package snowfall. I'd like to call a function (actually an Rcpp wrapper if this matters) from the package itself, so the function is currently not floating around in the environment.
sfInit(parallel=TRUE,cpus=Cpu)
sfExport("RcppFunction")
sfLapply(1:N,function(cc) RccpFunction(args))
sfStop()
Anytime I try to do this I get the following error message:
Error in sfExport("RcppFunction") :
Unknown/unfound variable RcppFunction in export. (local=TRUE)
I already tried some tutorials and online handbook, but did not found yet the solution how to export any function to snowfall within a package. As far as I see it doesn't really have to do that this particular function is an RcppFunction. I hope someone can help! Thanks in advance!
PS: I already found this post, but I cannot export my own package to snowfall - at least this doesn't make sense to me.