| esp_get_nuts | R Documentation |
The GISCO statistical unit dataset represents NUTS (Nomenclature of Territorial Units for Statistics) and statistical regions using multipart polygon, polyline and point topology. The NUTS geographical information is completed by attribute tables and a set of cartographic help lines to better visualize multipart polygonal regions.
NUTS is a hierarchical system divided into three levels:
NUTS 1: major socioeconomic regions.
NUTS 2: basic regions for the application of regional policies.
NUTS 3: small regions for specific diagnoses.
There is also a NUTS 0 level, which usually corresponds to the national boundaries.
esp_get_nuts(
year = 2024,
epsg = 4258,
cache = TRUE,
update_cache = FALSE,
cache_dir = NULL,
verbose = FALSE,
resolution = 1,
spatialtype = c("RG", "LB"),
region = NULL,
nuts_level = c("all", "0", "1", "2", "3"),
moveCAN = TRUE,
ext = "gpkg"
)
year |
Year character string or number. Release year of the file. See
|
epsg |
Character string or number. Projection of the map: 4-digit EPSG code. One of:
|
cache |
Logical. Whether to cache downloaded files. Defaults to |
update_cache |
Logical. If |
cache_dir |
Character string. A path to a cache directory. See Caching. |
verbose |
A logical value indicating whether to display informational messages. |
resolution |
A character string or numeric value with the geospatial data resolution. One of:
|
spatialtype |
Character string. Type of geometry to be returned. Options available are:
|
region |
Optional. A vector of region names, NUTS or ISO codes
(see |
nuts_level |
A character string with the NUTS level. One of |
moveCAN |
A logical |
ext |
Character. Extension of the file (default |
The NUTS nomenclature is a hierarchical classification of statistical regions and subdivides the EU economic territory into regions of three different levels (NUTS 1, 2 and 3, moving respectively from larger to smaller territorial units). NUTS 1 is the most aggregated level. An additional country level (NUTS 0) is also available for countries where the nation at statistical level does not coincide with the administrative boundaries.
The NUTS classification has been officially established through Commission Delegated Regulation 2019/1755. An unofficial NUTS-like classification has been defined for the EFTA countries, candidate countries and potential candidates based on a bilateral agreement between Eurostat and the respective statistical agencies.
A sf object.
Functions that download data store files in cache_dir. When cache_dir
is NULL, they use the active package cache, which defaults to a temporary
directory. Set update_cache = TRUE to replace an existing cached file.
See Caching strategies in esp_set_cache_dir() to configure a
persistent cache.
Please check the download and usage provisions on
giscoR::gisco_attributions().
GISCO NUTS distribution API: https://gisco-services.ec.europa.eu/distribution/v2/nuts/.
giscoR::gisco_get_nuts() retrieves NUTS data from GISCO.
esp_dict_region_code() converts Spanish subdivision identifiers.
NUTS boundary datasets:
esp_get_spain()
GISCO boundary data:
esp_get_ccaa(),
esp_get_munic(),
esp_get_prov(),
esp_get_spain()
nuts1 <- esp_get_nuts(nuts_level = 1, moveCAN = TRUE)
library(ggplot2)
ggplot(nuts1) +
geom_sf() +
labs(
title = "NUTS 1: Displacing Canary Islands",
caption = giscoR::gisco_attributions()
)
nuts1_alt <- esp_get_nuts(nuts_level = 1, moveCAN = c(15, 0))
ggplot(nuts1_alt) +
geom_sf() +
labs(
title = "NUTS 1: Displacing Canary Islands",
subtitle = "to the right",
caption = giscoR::gisco_attributions()
)
nuts1_orig <- esp_get_nuts(nuts_level = 1, moveCAN = FALSE)
ggplot(nuts1_orig) +
geom_sf() +
labs(
title = "NUTS 1",
subtitle = "Canary Islands in their true location",
caption = giscoR::gisco_attributions()
)
and_orient <- esp_get_nuts(region = c(
"Almeria", "Granada",
"Jaen", "Malaga"
))
ggplot(and_orient) +
geom_sf()
random_regions <- esp_get_nuts(region = c("ES1", "ES300", "ES51"))
ggplot(random_regions) +
geom_sf() +
labs(title = "Random Regions")
mixing_codes <- esp_get_nuts(region = c("ES4", "ES-PV", "Valencia"))
ggplot(mixing_codes) +
geom_sf() +
labs(title = "Mixing Codes")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.