Prof Ripley Thanks for your message - you are absolutely right. I should have provided more information.
Meanwhile, I found out that loading an R workspace prevented parApply from working properly. The workspace contains many objects and I could not figure out which one was responsible for causing error. Obviously I had given an object a name that is already used for a function required by parApply. Many thanks for your help - and apologies for not following the R posting guidelines. Best wishes Kristian Unger ________________________________________ Dr. Kristian Unger Arbeitsgruppenleiter Integrative Biologie / Head of Integrative Biology Group Abteilung für Strahlenzytogenetik / Research Unit of Radiation Cytogenetics Tel.: +49-89-3187-3515 Mob.: +49-160-90641879 Am 12.06.11 18:05 schrieb "Prof Brian Ripley" unter <rip...@stats.ox.ac.uk>: >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@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, rip...@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 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 ______________________________________________ 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.