Let me add another scoping problem in R, this time with the snowfall package. If I define a function in my global environment, and I try to use that one later in an sfApply(
I think you want to sfExport(func1), though I'm not sure if you need to do it in your .GlobalEnv or inside of func2. Hope that helps...
sfExport(func1)
.GlobalEnv
func2
> y <- matrix(1:10,ncol=2) > sfExport(list=list("func1")) > func2(y) [,1] [,2] [1,] 2 7 [2,] 3 8 [3,] 4 9 [4,] 5 10 [5,] 6 11