This online walkthrough accompanies a 3h “show-and-tell” workshop on making thematic (choropleth) maps in R.
The worked examples demonistrate the quickest routes for getting your data in R and on a map, with a focus on showing how spatial data can be integrated in a familiar tidyverse data-analysis workflow.
The examples demonstrate mainly static maps, but interactive thematic maps are included as well. R packages demonistrated are primary
Intended audience is basic R users (or those interested in seeing what R can do), who wish integrate spatial data into their “regular” (exploratory) data-analysis workflow, or who need a quick map. More advanced GIS-topics such as projection fall outside of the scope.
The material and examples are structured along the basic steps you generally take when making thematic maps:
I like hearing from you if this walkthrough has been useful somehow, if something is not working or can be improved, or if you are interested in a workshop.
You can copy-past the code snippets from the online pages, download (25MB) the entire set of material, or clone from Github.
Opening the file thematic_maps_with_r.Rproj
in the downloaded folder launches an Rstudio-project, after which you should be able to open, adapt, and run the Rmarkdown notebooks containing the examples (files ending in .Rmd).
install.packages('rmarkdown')
install.packages('sf')
install.packages('tmap')
install.packages('dplyr')
install.packages('readxl')
install.packages('eurostat')
install.packages('leaflet')
install.packages('haven')
install.packages('mapview')
install.packages('rgdal')
install.packages('tmaptools')
install.packages('countrycode')
install.packages('stringr')
install.packages('readr')
install.packages('ggplot2')
install.packages('htmlwidgets')
install.packages('rworldmap')
install.packages('lubridate')
install.packages("BelgiumMaps.StatBel", repos = "http://www.datatailor.be/rcube", type = "source")