Hello everybody,

I've got a bit of a problem with parLapply that's left me scratching my head
today.  I've tried this in R 2.11 and the 23 bit Revolution R Enterprise and
gotten the same result, OS in question is Windows XP, the package involved
is the snow package.

I've got a list of 20 rain/no rain (1/0) situations for these two stations i
and j, all the items in this list look like this, each of these have a
different order:

> setin[[20]]
   ri_1 rj_1
29    0    0
15    0    0
3     1    0
31    0    0
4     0    0
1     1    1
18    1    1
21    0    0
27    0    0
24    0    0
6     0    1
9     1    1
5     0    0
30    0    0
25    0    0
28    0    0
19    1    1
8     0    0
17    1    1
12    0    0
10    0    0
22    1    1
23    0    0
7     1    1
14    0    0
26    0    0
13    0    0
2     0    1
11    1    1
20    1    1
16    1    1

What I'm trying to do is to apply the same function I crafted to all the
items in the list with parLapply.  I'm using this instead of apply since it
allows me to test using parallel running R, and because it runs faster than
lapply.

M_set <-
parLapply(cl,setin,M.set.find,month=month,n1=n1,n2=n2,MC_1st_obs2=MC_1st_obs2)

using this it gives me the follow error:

Error in do.call("fun", lapply(args, enquote)) :
  could not find function "fun"

but, this works correctly when I just use lapply (it's just a bit slower
than I need it to be).  Also, I know that the clusterCall function works
fine with my homemade function because all the nodes of the cluster return
the appropriate results when I try this:

clusterCall(cl,M.set.find,setin=setin[[1]],month=month,n1=n1,n2=n2,MC_1st_obs2=MC_1st_obs2)

but that will only let me do this calculation one at a time.

I perused the earlier post about this error, and that doesn't work for me, I
don't do anything anywhere in my code to mess with "c".  I also know that my
code is producing the rest of the required parts for the function correctly.

I wish I could provide more on what's happened, but the code involved is
somewhat extensive.  Any ideas all of you have would be wonderful.

Thanks in advance!

A
-- 
Adrienne Wootten
Graduate Research Assistant
State Climate Office of North Carolina
Department of Marine, Earth and Atmospheric Sciences
North Carolina State University

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to