# RasterLayer
r <- raster(nrows=36, ncols=18)
r <- setValues(r, runif(ncell(r)))
plot(r)
plot(extent(r))
# 2 RasterLayers
r2 <- sqrt(r)
plot(r, r2)
# RasterStack
s <- stack(r, r2, r/r)
plot(s, 2)
plot(s)
# plotting of a file with a color table:
data(drg)
e <- c(-220185.3, -219058.2, -30911.26, -29966.9)
plot(drg, extent=e)
#plot(drg, maxpixels=ncell(drg), interpolate=TRUE)
Run the code above in your browser using DataLab