On Sun, 12 Jun 2011, Unger, Kristian, Dr. wrote:
> Hi
>
> I try parallelising some code using the snow package and the following
lines:
>
> cl <- makeSOCKcluster(8)
> pfunc <- function (x) (if(x <= (-th)) 1 else 0) ###correlation
coefficient
>
> clusterExport(cl,c("pfunc","th"))
> cor.c.f <- parApply(cl,tms,c(1,2),FUN=pfunc)
>
> The parApply results in the error message:
>
>> cor.c.f <- parApply(cl,tms,c(1,2),FUN=pfunc)
> Error in do.call("fun", lapply(args, enquote)) :
> could not find function "fun".
>
> Any ideas?
See the footer of this message: that example is not reproducible.
What is 'th'? What is 'tms'?
With some plausible guesses for those this works for me. The error
message appears to be from snow's function docall(), but without even
a traceback(), it is impossible to guess which call to docall() is
involved. This is why we ask for a reproducible example.
You are also missing the 'at a minimum' information requested in the
posting guide.
>
> Best wishes
>
> Kristian
>
> ________________________________
> Helmholtz Zentrum M?nchen
> Deutsches Forschungszentrum f?r Gesundheit und Umwelt (GmbH)
> Ingolst?dter Landstr. 1
> 85764 Neuherberg
> www.helmholtz-muenchen.de
> Aufsichtsratsvorsitzende: MinDir?in B?rbel Brumme-Bothe
> Gesch?ftsf?hrer: Prof. Dr. G?nther Wess und Dr. Nikolaus Blum
> Registergericht: Amtsgericht M?nchen HRB 6466
> USt-IdNr: DE 129521671
>
> [[alternative HTML version deleted]]
No HTML: seee the posting guide.
> ______________________________________________
> R-help at 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.
>
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595