Note: tutorials are currently still under development, and more will be added in the upcoming year. All tutorials are in the R programming language, save for one PostGIS tutorial.

R Spatial Workshop Notes - new!

Workshop notes and scripts from the R Spatial Workshop can be found at the following link. Topics to be covered include spatial data manipulation, mapping, and interactive visualization.

Please see our Events page for more information about these workshops.

Introduction to Spatial Data Science

Below are the R lab notes from Luc Anselin’s Introduction to Spatial Data Science course at the University of Chicago taught in Fall 2018. These labs mirror the GeoDa notebooks, but use R rather than GeoDa. Thank you Grant Morrison for his work on these R tutorials.

  • Spatial Data Handling: Import, manipulate, and map abandoned vehicle data to make a choropleth map of abandoned vehicles per capita for Chicago community areas.
  • Exploratory Data Analysis 1 - Univariate and Bivariate Analysis: Explore NYC socioeconomic data by borough and perform exploratory spatial analysis involving univariate plots, smoothing methods, and linear fits.
  • Exploratory Data Analysis 2 - Multivariate Exploration: Continue to explore NYC socioeconomic data using spatial data analysis methods for three or more variables, including scatter plots, bubble plots, and parallel coordinate plots.
  • Basic Mapping: Finish working with NYC socioeconomic data by creating and customizing a variety of maps, including choropleth maps, conditional maps, and cartograms.

Choropleth Map of Abandoned Vehicle Per Capita in Chicago and Box Map of Rent in NYC

Cluster Analysis in R

The following tutorials were prepared by Luc Anselin in 2017 for his Introduction to Spatial Data class.

  • Dimension Reduction Methods: Learn about Principal Components Analysis (PCA) and multidimensional scaling using the [Guerry_85]() dataset and the foreign and ggplot2 R packages.
  • Classic Clustering Methods: Use hierarchical clustering and k-means clustering on the same dataset with the hclust and kmeans functions in base R.
  • Spatially Constrained Clustering Mehods: Carry out contiguity-constrained clustering with SKATER algorithm and the rgdal, spdep, and maptools packages.

Basic R Tutorials

The following are notes that Luc Anselin has put together to introduce R to his undergraduate classes. They provide an overview of data manipulation and visualization methods, using geographic data as an example.

  • Manipulating Data Frames: Read, write, summarize, and wrangle data with the foreign R package (for dbf files) and the tidyverse.
  • Data Visualization (1): Visualize data using the ggplot2 package, creating scatterplots and fitting lines to NYC sub-borough data.
  • Data Visualization (2): Extend the visualizations of the previous tutorial, using ggplot2 to customize scatterplots, create histograms, boxplots, and more. Learn about reshaping data into a tidy format using tidyr.
  • Basic Mapping: Manipulate and map spatial data, creating custom choropleth maps with NYC borough data, using the sf, tmap, and RColorBrewer packages.

Spatial Join in R

This tutorial, put together by Marynia Kolak in November 2017, shows how to do spatial joins and aggregations using the spatialeco, foreign, and rgdal packages. Updated content using the sf package will be uploaded shortly.

PostGIS Tutorial

Learn how to create spatial queries and perform spatial analysis in PostGIS databases using this tutorial developed by Clayton Hunter and Julia Koschinsky.