if (require("ggplot2", quietly = TRUE) &&
bru_safe_sp()) {
# Load Gorilla data
data(gorillas, package = "inlabru")
# Turn elevation covariate into SpatialPixels
pxl <- sp::SpatialPixels(sp::SpatialPoints(gorillas$gcov$elevation))
# Plot the pixel centers
ggplot() +
gg(pxl, size = 0.1)
}
Run the code above in your browser using DataLab