extract from {raster} package using excessive memory
I have been using the extract function from the raster package to extract data from raster files using an area defined by shapefiles. However, I am having problems with the amount of memory that this process is now requiring. I do have a large number of shapefiles (~1000). The raster files are large (~1.6gb) My process is: shp <- mclapply(list.files(pattern="*.shp",full.names=TRUE), readShapePoly,mc.cores=6) ndvi <- raster("NDVI.dat") mc<- function(y) { temp <- gUnionCascaded(y) extract <- extract(ndvi,temp) mean <- range(extract, na.rm=T )[1:2] leng <- length(output) } output <- lapply(shp,