library(lattice)
data(Switzerland)
str(Switzerland)
levelplot(elevation ~ x + y, Switzerland, aspect="iso",
col.regions=terrain.colors(100))
if (FALSE) {
library(raster)
el.r <- rasterFromXYZ(Switzerland[,c("x","y","elevation")], crs =
"+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333
+k_0=1 +x_0=600000 +y_0=200000 +ellps=bessel
+towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs")
plot(el.r)
spplot(el.r)
}
Run the code above in your browser using DataLab