Course Overview
This chapter explains what the course aims, structure, content and what you need to have ready before our first session.
Course aims
The course introduces a useful set of ideas and techniques for working with spatial data in the social sciences. The emphasis is practical and applied. The course provides an understanding of what makes spatial data distinctive, when different spatial methods are appropriate, how to implement them in R and illustrates the use of methods using real-world data. The course aims to be reproducible and replicable so students can re-use the material for their own analysis and datasets.
By the end of the course, students should be able to read and handle spatial data, visualise spatial patterns, analyse point events and flows, and understand the logic behind models of spatial dependence and spatial heterogeneity.
Who this course is for
This course is designed primarily for MSc and PhD students in the social sciences, and applied researchers who want to bring spatial thinking into their work. Some participants may already feel comfortable with statistics but have limited experience with spatial data. Others may know the substantive problems they want to study, but be less familiar with R, Quarto, or reproducible computational workflows.
The course is written with both groups in mind. It assumes curiosity and a willingness to work practically with data. The course assumes students have some basic familiarity with GIS, spatial econometrics or programming. It does not assume they already have specialist training in these areas.
How the course is organised
The course is structured as a progression from spatial data foundations and key concepts to applied modelling. Each chapter weakly builds on the previous, so there is sequence that matters. Examples and geographies in each individual chapter vary to provide students with exposure to different types of data and context.
Part I introduces the main ideas behind spatial thinking and the practical tools needed to work with spatial data in R.
Part II focuses on point patterns and flows, showing how to analyse events in space and connections between places.
Part III introduces models for spatial dependence and spatial heterogeneity, helping us understand why spatial relationships are often clustered and uneven across space.
The practical teaching sequence is:
- welcome and course orientation
- embedding space
- spatial data wrangling
- point patterns
- spatial interaction modelling
- spatial dependence
- spatial heterogeneity
How this course fits in the wider toolkit
This course does not try to replace a full GIS, econometrics or statistics course. Instead, it acts as a bridge between general data analysis and explicitly spatial data analysis in R, with an emphasis on social-science applications.
Students who continue beyond the course should see this material as a foundation rather than an endpoint. The methods introduced here can be extended into more advanced work in spatial econometrics, point process modelling, geocomputation, network analysis, spatio-temporal modelling and causal analysis with spatial data. The aim is to give students enough conceptual grounding and practical fluency that they can continue exploring these areas independently.
What you need before the course starts
Please do this before the first session. We will not have time during the course to help everyone complete software installation, and we will begin the practical work immediately.
You will need a laptop with the software below installed and working before the first session. Please make sure everything is installed and opens correctly in advance so you can take part in the practical work from the start.
You should install:
After installing these, please check that:
Ropens successfully- RStudio opens successfully and detects your R installation
- Quarto is installed and available to RStudio
R package dependencies
The course uses R packages for data manipulation, spatial data handling, mapping, interpolation, and modelling. The list below has been checked against the package calls currently used in Chapters 01 to 06, so it is a better guide to what students will actually need as they move through the course.
The main package groups are:
- workflow and data tools such as
tidyverse,lubridate, andbroom - spatial data tools such as
sfandspData - mapping and visualisation tools such as
tmap,viridis,scales, andggthemes - point-pattern and interpolation tools such as
MASSandgstat - spatial analysis and modelling tools such as
spdepandspatialreg
To install the packages needed across the course from inside R, use:
install.packages(c(
"tidyverse",
"sf",
"tmap",
"viridis",
"ggthemes",
"spData",
"gstat",
"lubridate",
"broom",
"scales",
"spdep",
"spatialreg"
))Two additional packages appear in the chapter code but usually do not need separate installation because they are distributed with R:
MASSgrid
If a package used in a chapter is missing on your machine, R will usually tell you when you try to run the code. Students who want to prepare more fully can also look at the package calls at the top of each chapter and install anything extra in advance.
Useful references:
How to use the repository
The course materials are organised as a Quarto book repository. This means the files include narrative text, executable code, figures and references. Students should download the repository, run the code locally, and are encouragued to reuse the structure for their own learning and future work.
There are two simple ways to get the repository onto your computer:
Option 1: Download the repository as a ZIP file
If you are less familiar with Git, the easiest option is usually to download the repository as a ZIP file from GitHub, extract it to a folder on your laptop, and open the project in RStudio.
General steps:
- open the repository page in your browser
- choose the option to download the repository as a ZIP file
- extract the ZIP file to a location you can easily find
- open the project folder in RStudio
Option 2: Clone the repository with Git
If you already use Git, you can clone the repository to your laptop and work with it locally. This is often the cleaner option if you expect to make your own edits, keep notes, or update your local copy later.
General steps:
- copy the repository URL
- clone it to your laptop with Git
- open the project folder in RStudio
Opening the project in RStudio
Once the repository is on your machine, open the project folder in RStudio. If there is an .Rproj file in the repository, open that file directly. This usually gives the cleanest working setup and helps keep paths and files organised correctly.
Within RStudio, students should be able to:
- open and read the
.qmdchapter files - run code chunks
- inspect the data files used in the course
- render documents if needed
Reusing the repository for your own work
One of the goals of the course is to teach specific methods and provide a reusable structure for your own projects. Students can adapt the repository by replacing the example datasets with their own data, modifying the code chunks, and using the chapter workflows as templates for future assignments or research notebooks.
A key strength of working with Quarto and R is that narrative, code and output live together in a form that is easier to reproduce, revise and extend. Even after the course ends, the repository should remain useful as a reference and a starting point for independent work.
Preparation checklist
Before the course starts, please make sure that you have:
- installed R
- installed RStudio Desktop
- installed Quarto
- installed the core
Rpackages used in the course - downloaded or cloned the repository
- opened the project successfully on your laptop