How to parallelize the .call function

3

I need to do a mount from multiple rasters to a single raster . Both the raster::merge and raster::mosaic functions work well in this situation, however I need to make a do.call to call the function to mount the multiple rasters that are in a list.

How to do this parallelized ? How to make do.call faster?

require(raster)
r <- raster(ncol=100, nrow=100)
r1 <- crop(r, extent(-10, 11, -10, 11))
r1[] <- 1:ncell(r1)
r2 <- crop(r, extent(0, 20, 0, 20))
r2[] <- 1:ncell(r2)
r3 <- crop(r, extent(9, 30, 9, 30))
r3[] <- 1:ncell(r3)
rast.list <- list(r1, r2, r3)     
rast.list$fun <- mean
rast.mosaic <- do.call(mosaic,rast.list)
    
asked by anonymous 18.01.2017 / 14:47

0 answers