Returns Comarcas of Spain. Comarcas are traditional informal territorial division, comprising several municipalities sharing geographical, economic or cultural traits, typically with not well defined limits.
Usage
esp_get_comarca(
region = NULL,
comarca = NULL,
moveCAN = TRUE,
type = c("INE", "IGN", "AGR", "LIV"),
epsg = 4258,
update_cache = FALSE,
cache_dir = NULL,
verbose = FALSE
)Arguments
- region
character string. A vector of names and/or codes for provinces or
NULLto get all the comarcas. See Details.- comarca
character string. A name or
regexexpression with the names of the required comarcas.NULLwill return all the possible comarcas.- moveCAN
A logical
TRUE/FALSEor a vector of coordinatesc(lat, lon). It places the Canary Islands close to Spain's mainland. Initial position can be adjusted using the vector of coordinates. See Displacing the Canary Islands inesp_move_can().- type
character string. One of
"INE","IGN","AGR","LIV". Type of comarca to return, see Details.- epsg
character string or number. Projection of the map: 4-digit EPSG code. One of:
"4258": ETRS89"4326": WGS84."3035": ETRS89 / ETRS-LAEA."3857": Pseudo-Mercator.
- update_cache
logical. Should the cached file be refreshed? Default is
FALSE. When set toTRUE, it will force a new download.- cache_dir
character string. A path to a cache directory. See Caching strategies section in
esp_set_cache_dir().- verbose
logical. If
TRUEdisplays informational messages.
Value
A sf object.
Details
When using region you can use and mix names and NUTS codes
(levels 1, 2 or 3), ISO codes (corresponding to level 2 or 3) or
"cpro" (see esp_codelist).
When calling a higher level (Province, Autonomous Community or NUTS1), all the comarcas of that level will be added.
Note
The use of the information contained on the INE website may be carried out by users or re-use agents, at their own risk, and they will be the sole liable parties in the case of having to answer to third parties due to damages arising from such use.
About comarcas
'Comarcas' (English equivalent: district, county, area or zone) does not always have a formal legal status. They correspond mainly to natural areas (valleys, river basins, etc.) or even to historical regions or ancient kingdoms.
In the case of Spain, comarcas only have an administrative character legally recognized in Catalonia, the Basque Country, Navarra (named merindades instead), in the region of El Bierzo (Castilla y Leon) and Aragon. Galicia, the Principality of Asturias, and Andalusia have functional comarcas.
Types
esp_get_comarca() can retrieve several types of comarcas, each one
provided under different classification criteria.
"INE": Comarcas as defined by the National Statistics Institute (INE)."IGN": Official comarcas, only available on some Autonomous Communities, provided by the National Geographic Institute."AGR": Agrarian comarcas defined by the Ministry of Agriculture, Fisheries and Food (MAPA)."LIV": Livestock comarcas defined by the Ministry of Agriculture, Fisheries and Food (MAPA).
Note
Please check the download and usage provisions on gisco_attributions().
See also
Other datasets representing political borders:
esp_get_capimun(),
esp_get_ccaa(),
esp_get_ccaa_siane(),
esp_get_countries_siane(),
esp_get_gridmap,
esp_get_munic(),
esp_get_munic_siane(),
esp_get_nuts(),
esp_get_prov(),
esp_get_prov_siane(),
esp_get_simpl,
esp_get_spain(),
esp_get_spain_siane(),
esp_siane_bulk_download()
Examples
# \donttest{
comarcas <- esp_get_comarca(moveCAN = FALSE)
library(ggplot2)
ggplot(comarcas) +
geom_sf()
# IGN provides recognized comarcas
rec <- esp_get_comarca(type = "IGN")
ggplot(rec) +
geom_sf(aes(fill = t_comarca))
# Legal Comarcas of Catalunya
comarcas_cat <- esp_get_comarca("Catalunya", type = "IGN")
ggplot(comarcas_cat) +
geom_sf(aes(fill = ine.prov.name)) +
labs(fill = "Province")
# }
