if (FALSE) {
library(lattice)
data(cruz)
str(cruz)
levelplot(elevation ~ x + y, cruz, aspect="iso",
col.regions=terrain.colors(100))
if(require(raster)) {
elev <- rasterFromXYZ(cruz[,1:3],
crs="+proj=utm +zone=11 +ellps=GRS80 +datum=NAD83 +units=m +no_defs")
elev
plot(elev)
}
}
Run the code above in your browser using DataLab