gmap {inlabru}R Documentation

Plot a map using extent of a spatial object

Description

Uses ggmap::get_map() to query map services like Google Maps for a region centered around the spatial object provided. Then calls ggmap() to plot the map.

Usage

gmap(data, ...)

Arguments

data

A Spatial* object.

...

Arguments passed on to get_map().

Details

This function requires the ggmap package.

Value

a ggplot object

Examples

## Not run: 
if (requireNamespace("ggmap", quietly = TRUE) &&
  require("ggplot2", quietly = TRUE)) {
  # Load the Gorilla data
  data(gorillas, package = "inlabru")

  # Create a base map centred 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)
}

## End(Not run)

[Package inlabru version 2.11.1 Index]