5.3 plot methods for raster
objects
Let’s get a raster layer of altitude in Belgium using again getData()
.
#R> Warning in getData("alt", country = "Belgium", path = "data"): getData will be removed in a future version of raster
#R> . Please use the geodata package instead
We can also add different layers of information on this maps:
Or reclassify and change the color palette:
# Assign color to a object
myCol <- terrain.colors(3)
plot(alt,
breaks = c(0, 200, 400, 700),
col = myCol,
main = "Altitude map of Belgium")