gg.sf: Geom helper for sf objects

View source: R/ggplot.R

gg.sfR Documentation

Geom helper for sf objects

Description

This function uses geom_sf(), unless overridden by the geom argument. Requires the ggplot2 package.

Usage

## S3 method for class 'sf'
gg(data, mapping = NULL, ..., geom = "sf")

Arguments

data

An sf object.

mapping

Default mapping is ggplot2::aes(geometry = ...), where the geometry name is obtained from attr(data, "sf_column"). This is merged with the user supplied mapping.

...

Arguments passed on to geom_sf or geom_tile.

geom

Either "sf" (default) or "tile". For "tile", uses geom_tile(..., stat = "sf_coordinates"), intended for converting point data to grid tiles with the fill aesthetic, which is by default set to the first data column.

Value

A ggplot return value

See Also

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


inlabru-org/inlabru documentation built on April 25, 2024, 2:43 p.m.