Chapter 22 Spatial Data (including mapping)
22.1 Introduction
Cartographic design principles
- U.K. Ordnance Survey, “Cartographic design principles”
Choropleth maps
- vis4net, “Why we didn’t use a cartogram in the Brexit map” (2016)
22.2 Theory and methods
22.2.1 Map projections
A rich and complicated topic in and of itself: how can the surface of a sphere be represented in a two dimensional plane without distortion? (Answer: it can’t, but the distortion can be minimized to suit the purpose of the map.)
Randall B. Smith, 2011, Introduction to Map Projections (PDF file)
ESRI, Understanding Map Projections (PDF file)
Alberto Cairo, 2019-07-31, The Mercator projection isn’t “a monstrosity”
22.2.2 Geographic references (coordinate reference systems)
Spatial Reference – URL/URI-based references to spatial reference systems, including EPSG and ESRI.
Coordinate Reference Systems – from A Gentle Introduction to GIS
British Columbia’s standard is BC Albers (EPSG:3005)
Coordinate Reference System and Spatial Projection – from Spatial Data in R, part of an Earth Analytics course.
22.3 Canadian geography: shapefiles
Statistics Canada has made available a variety of boundary files.
DataBC has a number of of geographic boundary files available
22.4 R
22.4.1 Spatial Data in R: text books
Roger S. Bivand, Edzer J. Pebesma, and Virgilio Gómez-Rubio (2008) Applied Spatial Data Analysis with R {PDF version of text book}
Robin Lovelace, Jakub Nowosad, and Jannes Muenchow, Geocomputation with R
Geographic projections and transformations – workbook based on Chapter 6 of Geocomputation with R
Edzer Pebesma and Roger Bivand, Spatial Data Science – textbook, work in progress.
Manuel Gimond, Intro to GIS and Spatial Analysis – “compilation of lecture notes for my Introduction to GIS and Spatial Analysis course (ES214)” at Colby College, Maine.
22.4.2 Spatial Data in R: blogposts, tutorials, etc.
twitter thread on “geocomputation in R”:
Aleszu Bajak, 2018-12-20, “How to map point data and polygon shapefiles in R”
Frank Davenport (2012) “Notes from A Recent Spatial R Class I Gave”
Nick Eubank, Merging Spatial Data
Matthias Forkel (2015) Analysis of spatial data in R {PDF version of presentation/lecture slide deck}
Kieran Healy, 2018-12-09, Canada Map
Tomislav Hengl, A Practical Guide to Geostatistical Mapping {PDF ebook available via Lulu}
Jacinta Holloway, raster2data
- “This repository provides some introductory guidance for working with spatial image files, like rasters, and converting these to dataframes in R in order to perform statistical analyses. Includes an example satellite image and R code.”
Katie Jolly, 2019-08-15, Geographic Data Science in R – presentation at R North 2019 conference.
Arda Kosar, 2018-05-01, A Beginner’s Exploration of Shiny and Leaflet for Interactive Mapping
Robin Lovelace (2014) “R, an Integrated Statistical Programming Environment and GIS” {blog post}
Robin Lovelace, James Cheshire and others, 2015-, Introduction to visualising spatial data in R {or up-to-date version on github, Robinlovelace/Creating-maps-in-R {tutorial}
Sharon Machlis (2016) Create maps in R in 10 (fairly) easy steps, Computerworld (2016-03-01)
Mel Moreno and Mathieu Basille, 2018-10-25, Drawing beautiful maps programmatically with R, sf and ggplot2
Mark Padgham, Geoff Boeing, et al., 2019-08-07, An Introduction to Software Tools, Data, and Services for Geospatial Analysis of Stroke Services, Frontiers in Neurology, 07 August 2019 | https://doi.org/10.3389/fneur.2019.00743
Vivek Patil (2015) Animated choropleths using animation, ggplot2, rCharts, googleVis, and Shiny (2014-01-17)
Francisco Rodriguez-Sanchez, 2013-12-18, Spatial data in R: Using R as a GIS {github version at Pakillo/R-GIS-tutorial}
Dominic Royé, 2018-11-03, Accessing OpenStreetMap data with R
Mithil Shah, 2016-04-18, R and GIS – working with shapefiles
Andrew Tran, 2019, Mapping with R NICAR19 session
22.4.2.1 other
R Spatial Cheatsheet {from Barry Rowlingson’s Geosppatial Data in R and Beyond tutorial site}
Maps and Data Visualisations with R (from spatial.ly)
Sharp Sight Labs, Simple practice: basic maps with the Tidyverse
Introduction to Geospatial Raster and Vector Data with R – Data Carpentry lesson
22.4.3 Canadian examples: maps in R
Canadian census map division in R
Choropleth Maps with R and ggplot2
22.5 R Packages
22.5.1 {cartography}
github page: cartography
22.5.2 {choroplethr}
package
CRAN page: choroplethr: Simplify the Creation of Choropleth Maps in R
articles
Combining Choropleth Maps and Reference Maps in R
Creating Administrative Choropleth Maps Using R
22.5.3 {ggmap}
package
CRAN page: [ggmap: Spatial Visualization with ggplot2] (https://cran.r-project.org/package=ggmap)
articles
Creating a custom soil attribute plot using ggmap
Laura Ellis, 2018-04-15, Map Plots Created With R And ggmap
David Kahle and Hadley Wickham, ggmap: Spatial Visualization with ggplot2 The R Journal Vol. 5/1, June 2013, pp.144-161.
Plotting Choropleths from Shapefiles in R with ggmap – Toronto Neighbourhoods by Population
R & GGMap Visualization Case Study
Visualising Crime Hotspots in England and Wales using {ggmap}
22.5.4 {ggspatial}
package
CRAN page: [ggspatial: Spatial Data Framework for ggplot2] (https://cran.r-project.org/package=ggspatial)
gihub page: A ggplot2 R extension for plotting Spatial objects
22.5.5 {GISTools}
package
CRAN page: [GISTools: Some further GIS capabilities for R] (https://cran.r-project.org/package=GISTools)
articles
22.5.6 {idbr}
package
CRAN page: idbr: R Interface to the US Census Bureau International Data Base API
github page: idbr
articles
Kyle Walker, Visualizing international demographic indicators with idbr and Plotly
22.5.7 {leaflet}
package
CRAN: leaflet: Create Interactive Web Maps with the JavaScript ‘Leaflet’ Library
RStudio on github: rstudio/leaflet
articles
Robin Lovelace, The leaflet package for online mapping in R
Gunnvant Singh, 2018-11-30, Quick Introduction To Leaflet Maps In R
Kyle Walker (2015) “Creating a Leaflet choropleth map with a pop-up in R” (2015-01-30)
Kyle Walker (2016) “Using a new Mapbox Studio map in an R Leaflet project” (2016-05-18)
Leaflet: an open-source JavaScript library for mobile-friendly interactive maps
22.5.8 {mapdeck}
“Provides a mechanism to plot an interactive map using ‘Mapbox GL’ (https://www.mapbox.com/mapbox-gl-js/api/), a javascript library for interactive maps, and ‘Deck.gl’ (http://deck.gl/#/), a javascript library which uses ‘WebGL’ for visualising large data sets.”
package
CRAN: mapdeck: Interactive Maps Using ‘Mapbox GL JS’ and ‘Deck.gl’
articles
Mapdeck - more than a map – poster presented at rstudio::conf 2020
22.5.9 {sf}
package
CRAN: sf: Simple Features for R
articles
Timo Grossenbacher, 2019-04-19, Bivariate maps with ggplot2 and sf
22.5.10 {sp}
package
CRAN: sp: Classes and Methods for Spatial Data
vignettes: Edzer Pebesma and Roger S. Bivand (2005): Classes and Methods for Spatial Data: the sp Package
articles
Edzer Pebesma (2008) Introduction to R and package sp
22.5.11 {tmap}
package
CRAN: tmap: Thematic Maps
vignettes: tmap in a nutshell
GitHub: tmap
articles
Corentin M. Barbu, 2015-11-06, “tmap R package”
Jakub Nowosad, 2019-10-17, Map coloring: the color scale styles available in the tmap package