Description Usage Arguments Value Examples
Deform basemap.
1 |
x |
an sf object (polygon or multipolygons). |
flatten |
numerical value indicating the scaling in Y (1 = no flattening). |
rescale |
a vector of two numeric values indicating the deformation of the top and bottom of the figure (c(1,1) = no deformation). |
an sf object (polygon or multipolygons).
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(sf)
us <- st_read(system.file("us.gpkg", package="mapextrud"))
f <- getframe(us)
us2 <- deform(us)
# Example 1 (default values)
f2 <- deform(f)
plot(st_geometry(f2))
plot(st_geometry(us2), add = TRUE)
# Exemple 2 (user values)
us3 <- deform(us, flatten=0.5, rescale = c(0.5, 3))
f3 <- deform(f, flatten=0.5, rescale = c(0.5, 3))
plot(st_geometry(f3))
plot(st_geometry(us3), add = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.