I'm developing an R package which needs to use parallelisation as made available by the snowfall
package. snowfall
doesn't seem to import the same was as other packages like ggplot2
, data.table
, etc. I've included snowfall
, rlecuyer
, and snow
in the description file, name space file, and as an import argument in the function itself. When I try to access this function, I get the following error:
Error in sfInit() : could not find function "setDefaultClusterOptions"
The sfInit
function seems to have a nostart
/ nostop
argument which it says is related to nested usage of sfInit
but that doesn't seem to do the trick for me either.
The actual code itself uses an sfInit
(which is where I get the error), some sfExport
s and sfLibrary
s, and an sfLapply
.
Possible solution:
It seems to work if I move snow
from the import section to the depends section in the Desciption file. I don't know why though.