loadCoordWR {mapping} | R Documentation |
Get worldwide countries coordinates
Description
Loads and returns names, ids, iso, and coordinates for world countries, ready to use with mapping
functions and other "map" functions that accept an sf
object.
Usage
loadCoordWR(unit = c("country", "nato", "ocde",
"continent", "region", "subregion",
"region_wb", "type_income", "type_economy"),
res = c("low", "hi"), unit_subset = NULL,
matchWith = NULL, dir = NULL, use_cache = TRUE,
use_internet = TRUE, crs = NULL)
Arguments
unit |
the type of world statistical unit |
res |
resolution |
unit_subset |
character vector of unit names to extract |
matchWith |
the type of id |
dir |
local directory in which shape files are stored |
use_cache |
a logical value indicating whether to use the cache |
use_internet |
a logical value indicating wheter the coordinates are downloaded from https://github.com/mappinguniverse/geospatial. If |
crs |
coordinate reference system. Look at |
Details
Coordinates are download from the Github repo https://github.com/mappinguniverse/geospatial from world folder https://github.com/mappinguniverse/geospatial/tree/master/world.
Value
A data.frame object with column indicating names, id, iso and the geometry to map.
Author(s)
Alessio Serafini
References
https://github.com/mappinguniverse/geospatial
See Also
loadCoordIT
, loadCoordEU
, loadCoordUS
, loadCoordDE
, loadCoordUK
Examples
WR_coords = loadCoordWR(res = "low")
str(WR_coords, 1)
WR_ocde = loadCoordWR(unit = "ocde",res = "low")
str(WR_ocde, 1)
WR_continent = loadCoordWR(unit = "continent",res = "low")
str(WR_continent, 1)