Chapter 22 Spatial Data (including mapping)

22.1 Introduction

Cartographic design principles

Choropleth maps

22.2 Theory and methods

A Gentle Introduction to GIS

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.)

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

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.5 R Packages

22.5.1 {cartography}

github page: cartography

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.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’

{mapdeck} reference

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

22.5.12 {urbnmapr}

articles

Sarah Strochak, How to Create State and County Maps Easily in R