useR! 2019 - Toulouse - 2019/07/09
sp & rgeos…sf with version 2.0.0 (Sep, 2017)ggplot2 (Wickham, 2016) + ggspatial (Dunnington, 2018)tmap (Tennekes, 2018)ggplot2)library(sf)
library(cartography)
# path to the geo file embedded in cartography
path <- system.file("gpkg/mtq.gpkg",
package = "cartography")
# import to an sf object
mtq <- st_read(dsn = path, quiet = TRUE)
# Set figure margins
par(mar = c(0,0,1.2,0), bg = "#b5d0d0")
# Plot the choropleth map
choroLayer(
x = mtq, var = "MED",
method = "equal", nclass = 4,
col = carto.pal(pal1 = "sand.pal", n1 = 4),
legend.values.rnd = -2, legend.pos = "left",
legend.title.txt = "Median Income\n(in euros)"
)
# Plot a layout
layoutLayer(
title="Wealth in Martinique, 2015",
author = "T. Giraud, 2019",
sources = "Sources: Insee and IGN - 2018",
scale = 5, north = TRUE,
tabtitle = TRUE, frame = FALSE
)
osrm: Gets road distances (time) between each municipalities.
SpatialPosition: Computes gravitationnal accessibility based on road distances.
cartography::getBreaks(): Classifies data
cartography::carto.pal(): Uses color palettes from the package
cartography::choroLayer(): Plots the choropleth mapsf: Provides geodata transformations
cartography::propSymbolsLayer(): Plots the proportional symbols
cartography::layoutLayer(): Plots the map layoutcartography::getPencilLayer(): Transforms polygons to hand-drawn polylines
cartography::choroLayer(): Plots the choropleth map
cartography::choroLayer(): Plots the choropleth map
cartography::getBorders(): Extract borders between countries
cartography::discLayer(): Plots discontinuities on borders
cartography::layoutLayer(): Plots the map layout
github.com/riatelab/cartography
@rgeomatic
rgeomatic.hypotheses.org