You need to load the snowfall
package on the cluster nodes. So insert
sfLibrary(snowfall)
after sfInit()
.
EDIT: For clarification:
Your function f1
contains the function sfLapply
, which is found in the snowfall
package. When you initialize the cluster using sfInit
as above, the snow
package is loaded on each node of the cluster, but not the snowfall
package. Without the latter, there is no object (function or otherwise) called sfLapply
on the nodes, and you get the error.