# NOT RUN {
## The following example require to have downloaded
## a large elevation raster with the function getelev()
## and will therefore not run unless you type:
## example(ElevRasterDE, run.dontrun=TRUE)
# }
# NOT RUN {
### Creating the object ElevRasterDE
## Download the tif file (ca. 700 Mb)
## (see ?getelev for details on how to get the tif file)
# getelev()
## Convert the tif into R raster format
if(require(raster)) {
elevationrasterbig <- raster("gmted2010_30mn.tif")
## Create the highly agregated elevation raster
ElevRasterDE <- relevate(elevationrasterbig,
aggregation.factor = 10,
manual.crop = c(5.5, 15.5, 47, 55.5))
## Plot the elevation
if (require("sp") & require("rasterVis")) {
levelplot(ElevRasterDE, margin = FALSE, par.settings=RdBuTheme()) +
layer(sp.polygons(CountryBorders, col = "white"))
}
## Compute crudely the resolution:
median(values(area(ElevRasterDE))) ## approximative size of cells in km2
}
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab