### DIFFERENCES IN AGGREGATION
## Loading objects
data(elevationrastersmall)
data(GNIP_Model)
data(worldcountries)
data(oceanmask)
## We aggregate and crop using different settings
elevation.raster1 <- RElevate(
elevation.raster=elevationrastersmall,
isofit=GNIP_Model,
aggregation.factor=0)
elevation.raster2 <- RElevate(
elevation.raster=elevationrastersmall,
isofit=GNIP_Model,
aggregation.factor=5)
elevation.raster3 <- RElevate(
elevation.raster=elevationrastersmall,
isofit=GNIP_Model,
aggregation.factor=5, aggregation.fun=max)
## The following plot takes a few second too many and will
## therefore not be run unless you type:
## example(RElevate, run.dontrun=TRUE)
## Not run:
# ## We plot the outcome of the 3 different aggregation schemes
# if(require(rasterVis)) {
# data(worldcountries)
# data(oceanmask)
# plot.aggregation1 <- levelplot(elevation.raster1,
# margin=FALSE, main="Original small raster") +
# layer(sp.polygons(worldcountries)) +
# layer(sp.polygons(oceanmask, fill="blue"))
# plot.aggregation2 <- levelplot(elevation.raster2,
# margin=FALSE, main="Small raster aggregated (by mean)") +
# layer(sp.polygons(worldcountries)) +
# layer(sp.polygons(oceanmask, fill="blue"))
# plot.aggregation3 <- levelplot(elevation.raster3,
# margin=FALSE, main="Small raster aggregated (by max)") +
# layer(sp.polygons(worldcountries)) +
# layer(sp.polygons(oceanmask, fill="blue"))
# ## panel using lattice syntax:
# print(plot.aggregation1, split=c(1, 1, 1, 3), more=TRUE)
# print(plot.aggregation2, split=c(1, 2, 1, 3), more=TRUE)
# print(plot.aggregation3, split=c(1, 3, 1, 3))
# }
# ## End(Not run)
Run the code above in your browser using DataLab