clipout_polygon | R Documentation |
This functions is a helper function to be used in combination to extract_polygon()
.
It removes a set of polygons nested within a multipolygon sf geometry.
clipout_polygon(data, countryname_eng, lon, lat)
data |
A dataset containing at least the columns |
countryname_eng |
The name of a country in English |
lon |
A vector of 2 longitude coordinates defining a box containing the polygons to extract |
lat |
A vector of 2 latitude coordinates defining a box containing the polygons to extract |
## Clipping out the polygon for French Guiana if (requireNamespace("rnaturalearth")) { world <- rnaturalearth::ne_countries(scale = "medium", returnclass = "sf") France <- world$geometry[world$name == "France"] plot(France) France2 <- clipout_polygon(data = world, countryname_eng = "France", lon = c(-55, -50), lat = c(6, 2)) plot(France2) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.