When plotting Spain, it is usual to represent the Canary Islands as an inset (see moveCAN on esp_get_nuts(). These functions provides complementary borders when Canary Islands are displaced.

esp_get_can_box is used to draw lines around the displaced Canary Islands.

esp_get_can_provinces is used to draw a separator line between the two provinces of the Canary Islands.

esp_get_can_box(style = "right", moveCAN = TRUE, epsg = "4258")

esp_get_can_provinces(moveCAN = TRUE, epsg = "4258")

Arguments

style

Style of line around Canary Islands. Four options available: "left", "right", "box" or "poly".

moveCAN

A logical TRUE/FALSE or a vector of coordinates c(lat, lon). It places the Canary Islands close to Spain's mainland. Initial position can be adjusted using the vector of coordinates.

epsg

projection of the map: 4-digit EPSG code. One of:

  • "4258": ETRS89

  • "4326": WGS84

  • "3035": ETRS89 / ETRS-LAEA

  • "3857": Pseudo-Mercator

Source

esp_get_can_provinces extracted from CartoBase ANE, se89_mult_admin_provcan_l.shp file.

Value

A LINESTRING or POLYGON object if style = "poly".

esp_get_can_provinces returns a LINESTRING object.

See also

Author

dieghernan, https://github.com/dieghernan/

Examples

Provs <- esp_get_prov() Box <- esp_get_can_box() Line <- esp_get_can_provinces() # Plot library(tmap) tm_shape(Provs) + tm_polygons() + tm_shape(Box) + tm_lines() + tm_shape(Line) + tm_lines()
# Displacing Canary Provs_D <- esp_get_prov(moveCAN = c(15, 0)) Box_D <- esp_get_can_box(style = "left", moveCAN = c(15, 0)) Line_D <- esp_get_can_provinces(moveCAN = c(15, 0)) tm_shape(Provs_D) + tm_polygons() + tm_shape(Box_D) + tm_lines() + tm_shape(Line_D) + tm_lines()
# Example with poly option # Get countries with giscoR # \donttest{ 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 tm_shape(Countries, bbox = c(-10, 34.6, 4.3, 44)) + tm_polygons(col = "#DFDFDF") + tm_shape(CANbox) + tm_polygons(col = "#C7E7FB") + tm_shape(CANbox) + tm_borders(lwd = 2) + tm_shape(CCAA) + tm_polygons("#FDFBEA") + tm_graticules(lines = FALSE) + tm_layout(bg.color = "#C7E7FB", frame.double.line = TRUE)
# }