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.
Get_Shapefile(
Year,
level = "LAU",
lightShp = TRUE,
autoAbort = FALSE,
centroids = FALSE
)
A spatial data frame of class data.frame
and sf
.
Numeric. Reference year for the administrative units.
Character. Either "LAU"/"Municipality"
, "NUTS-3"/"Province"
, "NUTS-2"/"Region"
, . "LAU"
by default
Logical. If TRUE
, the function downloads a generalised, i.e.less detailed, and lighter version of the shapefiles.
TRUE
by default.
Logical. Whether to automatically abort the operation and return NULL in case of missing internet connection or server response errors. FALSE
by default.
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. FALSE
by default.
# \donttest{
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")
# }
Run the code above in your browser using DataLab