waiver: Customizable coordinates zoom for ggplot maps

View source: R/sm_coordinates.R

waiverR Documentation

Customizable coordinates zoom for ggplot maps

Description

Set coordinate limits for a ggplot map based on a sf object or a bbox object, having an option for expanding the limits (expansion)

Usage

waiver()

Arguments

data

The dataframe containing the spatial information for the box limits.

bbox

An st_bbox objetc as a named vector for getting the box limits

expansion

a vector trbl for expandin any dimension over the initial limits

projected

logical, if T the original source (data or bbox) is in a projected CRS

Value

The coordinates for an accurate plot

Examples

## Not run:
librar(sf)
sf_utam %>%
ggplot() +
geom_sf(data = bogota_unido, fill = "#EBECF2") +
geom_sf(aes(fill = as.factor(ESTRATOPre)), alpha = 0.6) +
scale_fill_brewer("Estrato", palette = "YlGnBu") +
theme_void(base_family = "Franklin Gothic Book") +
theme(plot.background = element_rect(fill = "#EBECF2", color = NA),
plot.margin = margin(r = 10),
text = element_text(size = 10)) +
coord_sf_santi(bbox = a, expansion = space(r = 0.5))

samesag/emu documentation built on Aug. 22, 2023, 3:19 p.m.