Learn R Programming

giscoR (version 0.1.1)

gisco_get_nuts: Download Geospatial NUTS Data from GISCO

Description

Downloads a simple feature (sf) object.

Usage

gisco_get_nuts(
  resolution = "20",
  year = "2016",
  epsg = "4326",
  nuts_level = "all",
  cache = TRUE,
  update_cache = FALSE,
  cache_dir = NULL,
  spatialtype = "RG",
  country = NULL,
  nuts_id = NULL
)

Arguments

resolution

Resolution of the geospatial data. One of

  • "60" (1:60million),

  • "20" (1:20million)

  • "10" (1:10million)

  • "03" (1:3million) or

  • "01" (1:1million).

year

Release year. One of "2003", "2006", "2010", "2013", "2016" or "2021".

epsg

projection of the map: 4-digit EPSG code. One of:

  • "4326" - WGS84

  • "3035" - ETRS89 / ETRS-LAEA

  • "3857" - Pseudo-Mercator

nuts_level

NUTS level. One of "0" (Country-level), "1", "2" or "3". See https://ec.europa.eu/eurostat/web/nuts/background.

cache

a logical whether to do caching. Default is TRUE.

update_cache

a logical whether to update cache.

cache_dir

a path to a cache directory. The directory have to exist. The NULL (default) uses and creates /gisco directory in the temporary directory from tempdir. The directory can also be set with options(gisco_cache_dir = <path>).

spatialtype

Type of geometry to be returned:

  • RG: Regions - Multipolygon

  • LB: Labels - Point

  • BN: Boundaries - Multilines

country

Optional. A character vector of country codes. See Details

nuts_id

Optional. A character vector of NUTS IDs.

Value

a sf object.

Details

country only available when applicable. Some spatialtype datasets (as Multilines data-types) may not have country-level identifies.

country could be either a vector of country names, a vector of ISO3 country codes or a vector of Eurostat country codes.

See Also

gisco_countrycode, gisco_nuts

Examples

Run this code
# NOT RUN {
library(sf)

nuts2 <- gisco_get_nuts(nuts_level = "2", country = "ITA")
nuts3 <- gisco_get_nuts(nuts_level = "3", country = "ITA")

plot(
  st_geometry(nuts3),
  lwd = 1,
  border = "grey40"
)
plot(st_geometry(nuts2),
     add = TRUE)
title(
  main = "NUTS2 and 3 Levels on Italy",
  sub = gisco_attributions(),
  cex.sub = 0.7,
  line = 1
)
# }

Run the code above in your browser using DataLab