Get_Shapefile {SchoolDataIT} | R Documentation |
Download the shapefiles of Italian NUTS-3 and LAU administrative units
Description
Downloads either the boundaries or the centroids of the relevant administrative units, either provinces or municipalities, from the ISTAT website. Geometries are expressed in meters.
Usage
Get_Shapefile(
Year,
level = "LAU",
lightShp = TRUE,
autoAbort = FALSE,
centroids = FALSE
)
Arguments
Year |
Numeric. Reference year for the administrative units. |
level |
Character. Either |
lightShp |
Logical. If |
autoAbort |
Logical. Whether to automatically abort the operation and return NULL in case of missing internet connection or server response errors. |
centroids |
Logical. Whether to switch from polygon geometry to point geometry. In the latter case, the point is located at the centroid of the relevant area. |
Value
A spatial data frame of class data.frame
and sf
.
Source
<https://www.istat.it/it/archivio/222527>
Examples
library(magrittr)
Prov23_shp <- Get_Shapefile(2023, lightShp = TRUE, level = "NUTS-3", autoAbort = TRUE)
ggplot2::ggplot() + ggplot2::geom_sf(data = Prov23_shp) +
ggplot2::ggtitle("Italian provinces in 2023/01/01")