Learn R Programming

inlabru (version 2.11.1)

gm: ggplot geom for spatial data

Description

gm is a wrapper for the gg method. It will take the first argument and transform its coordinate system to latitude and longitude. Thereafter, gg is called using the transformed data and the arguments provided via .... gm is intended to replace gg whenever the data is supposed to be plotted over a spatial map generated by gmap, which only works if the coordinate system is latitude/longitude.

Usage

gm(data, ...)

Value

The form of the value returned by gm depends on the class of its argument. See the documentation of the particular methods for details of what is produced by that method.

Arguments

data

an object for which to generate a geom.

...

Arguments passed on to gg().

See Also

Other geomes for inla and inlabru predictions: gg(), gg.bru_prediction(), gg.data.frame(), gg.matrix()

Other geomes for spatial data: gg(), gg.SpatRaster(), gg.SpatialGridDataFrame(), gg.SpatialLines(), gg.SpatialPixels(), gg.SpatialPixelsDataFrame(), gg.SpatialPoints(), gg.SpatialPolygons(), gg.sf()

Other geomes for meshes: gg(), gg.fm_mesh_1d(), gg.fm_mesh_2d()

Other geomes for Raster data: gg(), gg.RasterLayer()

Examples

Run this code
if (FALSE) {
if (require("ggplot2", quietly = TRUE)) {
  # Load the Gorilla data
  data(gorillas, package = "inlabru")

  # Create a base map centered around the nests and plot the boundary as well as the nests
  gmap(gorillas$nests, maptype = "satellite") +
    gm(gorillas$boundary) +
    gm(gorillas$nests, color = "white", size = 0.5)
}
}

Run the code above in your browser using DataLab