# NOT RUN {
ccaa <- esp_get_ccaa()
library(ggplot2)
ggplot(ccaa) +
geom_sf()
# Random CCAA
Random <- esp_get_ccaa(ccaa = c(
"Euskadi",
"Catalunya",
"ES-EX",
"Canarias",
"ES52",
"01"
))
ggplot(Random) +
geom_sf(aes(fill = codauto), show.legend = FALSE) +
geom_sf_label(aes(label = codauto), alpha = 0.3)
# All CCAA of a Zone plus an addition
Mix <-
esp_get_ccaa(ccaa = c("La Rioja", "Noroeste"))
ggplot(Mix) +
geom_sf()
# Combine with giscoR to get countries
# }
# NOT RUN {
library(giscoR)
library(sf)
res <- 20 # Set same resoluion
europe <- gisco_get_countries(resolution = res)
ccaa <- esp_get_ccaa(moveCAN = FALSE, resolution = res)
# Transform to same CRS
europe <- st_transform(europe, 3035)
ccaa <- st_transform(ccaa, 3035)
ggplot(europe) +
geom_sf(fill = "#DFDFDF", color = "#656565") +
geom_sf(data = ccaa, fill = "#FDFBEA", color = "#656565") +
coord_sf(
xlim = c(23, 74) * 10e4,
ylim = c(14, 55) * 10e4
) +
theme(panel.background = element_rect(fill = "#C7E7FB"))
# }
Run the code above in your browser using DataLab