if (FALSE) {
# Some features require the raster and spatstat.data packages.
if (require("spatstat.data", quietly = TRUE) &&
require("raster", quietly = TRUE) &&
require("ggplot2", quietly = TRUE)) {
# Load Gorilla data
data("gorillas", package = "spatstat.data")
# Convert elevation covariate to RasterLayer
elev <- as(gorillas.extra$elevation, "RasterLayer")
# Plot the elevation
ggplot() +
gg(elev)
}
}
Run the code above in your browser using DataLab