gt_sf_rows: Add maps of simple features into rows of a 'gt' table

View source: R/gt_sf_rows.R

gt_sf_rowsR Documentation

Add maps of simple features into rows of a gt table

Description

Add maps of simple features into rows of a gt table with ggplot2. Function naming convention borrowed from gtExtras::gt_img_rows. Previously named gt_geom_sf_rows.

Usage

gt_sf_rows(
  gt_object,
  mapping = NULL,
  fill = NA,
  color = "black",
  size = 1,
  linetype = "solid",
  height = 100,
  asp = 1,
  geom = "sf",
  layer_fn = NULL,
  sf_label = "map",
  ...
)

Arguments

gt_object

An existing gt table object of class gt_tbl or an sf object. If a gt_object must be convertible to an sf object with sf::st_as_sf() (e.g. geometry must be retained before passing to gt::gt()).

mapping

aesthetic mapping passed to maplayer::layer_location_data(), Default: NULL

fill

Fill (used for polygon geometry), Default: NA

color

Color (used for polygon, point, and line geometry), Default: 'black'

size

Color (used for polygon, point, and line geometry), Default: 1

linetype

Color (used for polygon and line geometry), Default: 'solid'

height

The absolute height (px) of the map in the table cell

asp

The aspect ratio of the map in the table cell.

layer_fn

Optional rowwise function that results in ggplot2 map the replaces geometry column.

sf_label

Label used for column with ggplot2 map.


elipousson/birdseyeview documentation built on Sept. 26, 2022, 10:11 p.m.