View source: R/transform_to_inset.R
transform_to_inset | R Documentation |
This helper operates on an sf object to scale and translate its geometry according to the inset specification.
transform_to_inset(x, inset)
x |
Spatial data frame or other sf object; see |
inset |
Inset configuration; see |
A copy of x
with the geometry replaced by the transformed version.
library(sf)
nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE)
cfg <- configure_inset(
centre = st_sfc(st_point(c(-82, 35)), crs = 4326),
scale = 2,
translation = c(10, -60),
radius = 50,
units = "mi")
transform_to_inset(nc, cfg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.