loadCoordWR: Get worldwide countries coordinates

View source: R/WR.R

loadCoordWRR 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/dataallaround/geospatial. If FALSE the maps downloaded during package installation will be used.

crs

coordinate reference system. Look at st_crs

Details

Coordinates are download from the Github repo https://github.com/dataallaround/geospatial from world folder https://github.com/dataallaround/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/dataallaround/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)



mapping documentation built on Oct. 19, 2023, 5:06 p.m.