Learn R Programming

inlabru (version 2.11.1)

gg: ggplot2 geomes for inlabru related objects

Description

gg is a generic function for generating geomes from various kinds of spatial objects, e.g. Spatial* data, meshes, Raster objects and inla/inlabru predictions. The function invokes particular methods which depend on the class of the first argument.

Usage

gg(data, ...)

Value

The form of the value returned by gg 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 the geom method.

See Also

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

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

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

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

Examples

Run this code
if (require("ggplot2", quietly = TRUE)) {
  # Load Gorilla data

  data(gorillas, package = "inlabru")

  # Invoke ggplot and add geomes for the Gorilla nests and the survey boundary

  ggplot() +
    gg(gorillas$boundary) +
    gg(gorillas$nests)
}

Run the code above in your browser using DataLab