View source: R/geom_cartogramR.R
geom_cartogramR | R Documentation |
Apply the deformation used to build a cartogram to a set of simple geometry coordinates. The resulting simple geometry object can be used to add geometry features on the cartogram.
geom_cartogramR(sfgeom, carto, verbose = FALSE)
sfgeom |
a sf or a sfc object which contains simple feature geometry of
types in the following |
carto |
a cartogramR object |
verbose |
a boolean object to set on verbose mode (default to |
a sf or a sfc object which contains simple feature geometry transformed
data(usa) carto <- cartogramR(usa, "electors64") LA <- sf::st_sfc(sf::st_point(c(-118.243685, 34.052234))) sf::st_crs(LA) <- 4326 moregeom <- geom_cartogramR(LA, carto) plot(carto) plot(moregeom, add=TRUE, col=2, pch=15)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.