Sometimes you just want the canvas: country polygons, label-ready centroids, coastlines, internal borders, a graticule or an ocean rectangle – already projected, region-subset and antimeridian-safe. This is the building block the plotting functions sit on, exposed for power users.
Arguments
- what
What to return:
"countries"(default),"centroids","coastline","borders","graticule"or"ocean".- geometry
"polygon"(a tibble oflong/lat/group) or"sf".- scale
Natural Earth resolution for the
sfbackend:"small"(110m),"medium"(50m) or"large"(10m).- region
Optional subset: a continent, a group name, a vector of
iso3ccodes, or a bounding boxc(xmin, ymin, xmax, ymax).- projection
Projection for the
sfbackend (seeworld_map()).- recenter
Optional central meridian for a recentred map (e.g.
150).
Examples
# \donttest{
if (requireNamespace("maps", quietly = TRUE)) {
head(world_geometry("countries", geometry = "polygon"))
}
#> # A tibble: 6 × 8
#> long lat group order region subregion iso3c iso2c
#> <dbl> <dbl> <dbl> <int> <chr> <chr> <chr> <chr>
#> 1 -69.9 12.5 1 1 Aruba NA ABW AW
#> 2 -69.9 12.4 1 2 Aruba NA ABW AW
#> 3 -69.9 12.4 1 3 Aruba NA ABW AW
#> 4 -70.0 12.5 1 4 Aruba NA ABW AW
#> 5 -70.1 12.5 1 5 Aruba NA ABW AW
#> 6 -70.1 12.6 1 6 Aruba NA ABW AW
# }
