Skip to contents

Adds sample localities of a gData to a ggplot as a ggplot2::geom_sf() layer.

Usage

geom_gdata(
  data = NULL,
  mapping = ggplot2::aes(),
  original = FALSE,
  stat = "sf",
  position = "identity",
  na.rm = FALSE,
  show.legend = NA,
  ...
)

Arguments

data

a gData object.

mapping

aesthetics.

original

logical. If TRUE, plot at the original sample locations; if FALSE (default), plot at the assigned-node coordinates on the linked gGraph.

stat, position, na.rm, show.legend, ...

forwarded to ggplot2::geom_sf().

Value

a ggplot layer.

See also

Examples

library(ggplot2)
ggplot() +
  geom_gdata(data = hgdp, color = "black", size = 1.5) +
  theme_void()