Haven't tried to troubleshoot the problem, but your code works fine for me.
Looks like I'm running a slightly older versions of packages (notably, for raster). My session info is below. Here's my session info in case it helps: R version 3.1.2 (2014-10-31) Platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] snow_0.3-13 raster_2.2-31 sp_1.0-15 loaded via a namespace (and not attached): [1] grid_3.1.2 lattice_0.20-29 -Mike T On Fri, Feb 27, 2015 at 8:26 AM, <bastien.ferland-raym...@mffp.gouv.qc.ca> wrote: > Dear all, > > I wrote a code last year that was running well. I've retried the same > code this month and it's not working anymore. The problem arise from using > cluster to do resampling in the raster package on multiple threads. I've > tried on two computers, both have the problem. > > Here is a reproducible example : > > ### > > library(raster) > #Loading required package: sp > ## prepare the test rasters > r1 <- raster(nrows=1000, ncols=1000, xmn=0, xmx=1000) > set.seed(123) > values(r1) <- round(rnorm(1000000,100,20)) > r2 <- raster(nrows=1000, ncols=1000, xmn=.2, xmx=1000.2) > ## testing resample without multicore > resamp.single <- resample(r1, r2) > ## testing resample with multicore > beginCluster(11) > #Loading required namespace: snow > resamp.multi <- resample(r1, r2) > #Using cluster with 11 nodes > #Error in UseMethod("recvOneData") : > # no applicable method for 'recvOneData' applied to an object of class > "c('SOCKcluster', 'cluster')" > endCluster() > #Error in UseMethod("stopCluster") : > # no applicable method for 'stopCluster' applied to an object of class > "c('SOCKcluster', 'cluster')" > sessionInfo() > #R version 3.1.2 (2014-10-31) > #Platform: x86_64-w64-mingw32/x64 (64-bit) > > #locale: > #[1] LC_COLLATE=French_Canada.1252 LC_CTYPE=French_Canada.1252 > #[3] LC_MONETARY=French_Canada.1252 LC_NUMERIC=C > #[5] LC_TIME=French_Canada.1252 > > #attached base packages: > #[1] stats graphics grDevices utils datasets methods base > > #other attached packages: > #[1] raster_2.3-24 sp_1.0-17 > > #loaded via a namespace (and not attached): > #[1] grid_3.1.2 lattice_0.20-30 snow_0.3-13 > > > Any idea what the problem is? > > Thanks > > Bastien Ferland-Raymond, M.Sc. Stat., M.Sc. Biol. > Division des orientations et projets spéciaux > Direction des inventaires forestiers > Ministère des Forêts, de la Faune et des Parcs > > > [[alternative HTML version deleted]] > > > _______________________________________________ > R-sig-Geo mailing list > R-sig-Geo@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-geo > > [[alternative HTML version deleted]] _______________________________________________ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo