Introduction to Spatial Analysis in R

Online short course

Overview - spatial analysis in R short course

Spatial analysis is becoming an increasingly useful tool throughout public health research with increasing amounts of spatial health data generated each year. Whether you’re a humanitarian aid worker looking to add map making to your growing rapid analysis skillset or an early stage PhD student who wants to learn the fundamentals before progressing to geostatistics, this short course will be well suited to your needs.

Our hands on, practical approach to teaching, with real-life examples, means you can progress from no previous experience with R to applying R to your own work with confidence. We also place a strong emphasis on enabling students to continue their learning independently allowing your skillset to continue growing beyond the end of the course.

Course objectives

At the end of the course students should be able to:

  • Read in spatial and non-spatial datasets into R and perform basic data manipulation tasks using the “dplyr” package, make a variety of plots using the “ggplot2” package and demonstrate understanding of why different plot types are used for different types of data
  • Manipulate and visualise spatial data using maps with the “ggplot” package and be able to identify when different types of data projections should be used.
  • Understand how to analyse areal data and be able to implement and interpret simple regression analyses on areal datasets including the use of multi-level models
  • Be able to write clear, tidy and intuitive R code that can be reproduced by others and know how to conduct a “code review” of the work of others.
  • Identify the key characteristics of point data and understand and implement a variety of point data analysis techniques, such as kriging and Gaussian process regression. 

Who is this course for?

Practicing public health professionals and health researchers interested in adding expertise in spatial data analysis to their existing skillsets. Operational researchers and in particular those working in humanitarian crises / emergency deployments are particularly encouraged.

No previous experience with R or spatial data analysis is required, but some experience with quantitative data analysis using programmable computer software, e.g. plotting and analysing data in Stata, SAS, Python or MATLAB is expected. It is also expected that students are familiar with the use of the Generalised Linear Model (e.g. logistic regression, Poisson regression, multiple explanatory variables) and that computing is, or will be, part of their regular day-to-day role.        

Teaching methods

This online course is taught as a series of hands-on computer practicals using relevant public health examples from humanitarian crises. Sessions will be taught in the following format:

  • Introduction of session theory through a brief lecture and live coding demonstration by the session leader followed by time for student review
  • Presentation of an example dataset and a relevant public health problem which students are encouraged to discuss in small groups (up to 6 students) before beginning analysis
  • Independent work to code a reproducible solution aided by hints and full solutions available through the online system
  • Group presentation of the outputs and findings including justification for different methodological choices and how challenges were overcome
  • A 30 minute optional drop-in session at the end of each day where students can ask any remaining questions one-on-one with tutors
Course schedule
Course schedule - Introduction to Spatial Analysis in R

This course is delivered online over 10 days, and is taught as a series of hands-on computer practicals. Each day's session will follow the tentative timetable:

  • 13:00 - 14:30 - lecture with live coding
  • 14:30 - 14:45 - break
  • 14:45 - 16:15 - group practical facilitated by teaching assistants
  • 16:15 - 16:45 - drop in session for remaining questions

Day 1

  • Introduction to the R computer programme, vocabulary and format of different datatypes
  • Principles of tidy data

Day 2

  • Using the “dplyr” and “ggplot2” packages to create numerical and visual summaries of structured data sets
  • Practical session testing taught elements requiring a step by step approach to answer a real-world data analysis problem.

Day 3

  • Introduction to spatial data types and spatial data concepts.
  • Introduction to reading and visualising spatial data including interactive maps using “mapview”, “tmap”, and “sf” packages.
  • Visualisation of simple feature objects

Day 4

  • Demonstration of basic and some advanced spatial manipulations such as buffering, spatial joins, and distance calculations.
  • Practical requires combining the skills into logical steps to answer a spatial analysis problem.

Day 5

  • Revision of Generalised Linear Models and their extension as Generalised Linear Mixed Models and Generalised Additive Models

Day 6

  • Including distance to features as covariates in GLMMs
  • Poisson point process models

Day 7

  • Discrete space spatial models with Markov random field smoothers

Day 8

  • Further practical exercises on discrete space spatial models
  • Principles of code review
  • Reproducible reporting with R Markdown

Day 9

  • Continuous space spatial models with Gaussian process based smoothers

Day 10

  • Further practical exercises on continuous space spatial models
  • Interactive spatial visualisation
How to apply
How to apply - spatial analysis short course

Applying for this course

Applications for 2021 are now closed. Register your interest to be notified when applications reopen.

Please read LSHTM's Admissions policies prior to submitting your application.