[R-sig-Geo] Merging/averaging rasters with different extents
Tara Bridwell
tarabridwell at gmail.com
Wed Jan 4 20:23:13 CET 2012
My overall analytical goal is to take the mean (and later min and max)
data of a small resolution raster within the grid cells of a larger
resolution grid. I can do this using points via extract but can't
seem to do it using two rasters because of the different resolutions;
I am unable to stack or merge them.
A sample:
require(raster)
ex <- (c(0, 20, 0, 20))
r.small <- raster(ncol=10, nrow=10)
extent(r.small) <- ex
r.big <- raster(ncol=200, nrow=200)
extent(r.big) <- ex
What I want to be able to do is stack these two rasters, then take the
average value of the smaller resolution grid within the larger grids.
I am struggling to be able to do this, and would appreciate any
thoughts.
Many thanks.
More information about the R-sig-Geo
mailing list