loadCoordUK {mapping}R Documentation

Get United Kingdom coordinates

Description

Loads and returns names, id, and coordinates for United Kingdom statistical unit, to use with mapping functions and other "map" functions that accept an sf object.

Usage

loadCoordUK(unit = c("country", "county"), 
            year = c("2020", "2019"), scale = c("500", "20"), 
            unit_subset = NULL, matchWith = NULL, dir = NULL, 
            use_cache = TRUE, use_internet = TRUE, crs = NULL)

Arguments

unit

the type of Italian statistical unit to link

year

year of the analysis

scale

the scale of the map

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 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/mappinguniverse/geospatial from UK folder https://github.com/mappinguniverse/geospatial/tree/master/UK.

If unit is not specified, country borders are loaded.

Value

A data.frame object with column indicating names, id, and the geometry to map.

Author(s)

Alessio Serafini

References

https://github.com/mappinguniverse/geospatial

See Also

loadCoordEU, loadCoordWR, loadCoordUS, loadCoordDE

Examples


UK_coords = loadCoordUK(unit = "country", year = "2020")
str(UK_coords)




## Load subset

coords_uk <- loadCoordUK(unit = "county", unit_subset = "england", matchWith = "country")
coords_uk <- loadCoordUK(unit = "county", unit_subset = "hartlepool", matchWith = "county")




[Package mapping version 1.4.1 Index]