# NOT RUN {
Provs <- esp_get_prov()
Box <- esp_get_can_box()
Line <- esp_get_can_provinces()
# Plot
library(ggplot2)
ggplot(Provs) +
geom_sf() +
geom_sf(data = Box) +
geom_sf(data = Line) +
theme_linedraw()
# }
# NOT RUN {
# Displacing Canary
# By same factor
displace <- c(15, 0)
Provs_D <- esp_get_prov(moveCAN = displace)
Box_D <- esp_get_can_box(style = "left", moveCAN = displace)
Line_D <- esp_get_can_provinces(moveCAN = displace)
ggplot(Provs_D) +
geom_sf() +
geom_sf(data = Box_D) +
geom_sf(data = Line_D) +
theme_linedraw()
# Example with poly option
# Get countries with giscoR
library(giscoR)
# Low resolution map
res <- "20"
Countries <-
gisco_get_countries(
res = res,
epsg = "4326",
country = c("France", "Portugal", "Andorra", "Morocco", "Argelia")
)
CANbox <-
esp_get_can_box(
style = "poly",
epsg = "4326",
moveCAN = c(12.5, 0)
)
CCAA <- esp_get_ccaa(
res = res,
epsg = "4326",
moveCAN = c(12.5, 0) # Same displacement factor)
)
# Plot
ggplot(Countries) +
geom_sf(fill = "#DFDFDF") +
geom_sf(data = CANbox, fill = "#C7E7FB", lwd = 1) +
geom_sf(data = CCAA, fill = "#FDFBEA") +
coord_sf(
xlim = c(-10, 4.3),
ylim = c(34.6, 44)
) +
theme(
panel.background = element_rect(fill = "#C7E7FB"),
panel.grid = element_blank()
)
# }
Run the code above in your browser using DataLab