Spatial-r: Tutorials on spatial data analysis in R

Author
Affiliation

Romain Frelat

Published

July 31, 2025

Preface

This is a collection of tutorials on how to handle spatial data in R.

It is made for a two half-day workshop, but you can follow the tutorials on your own pace.

The aims of this workshop is to :

Feel more comfortable to work with spatial data
Load spatial data in R and visualize it
Extract information from remote sensing or other fields
Take advantage of the numerous databases that are available online

The tutorial targets students and scientists in ecology with previous knowledge of the R software.

R package

The tutorials will mostly rely on (terra R-package)[] for most of the spatial data handling.
R is exceptional due to its diversity, and their exist other package to handle spatial data, sf and stars being also very good resources.

Key resources

These tutorials has been inspired by brilliant resources online:

Preliminary program

Day 1
- lesson1 : INTRODUCTION GIS, vector vs raster view, projection system (CRS)
- tuto1 : VECTOR: create points and polygons; map and project spatial objects, calculate distance and areas
- tuto2 : RASTER: load and download rasters, change their resolutions, map etc
- tuto3 : EXTRACT: how to mix them: raster and points, raster and buffer, raster and polygons, projection raster>polygon

Day 2
- lesson2 : INTRODUCTION GIS, vector vs raster view, projection system (CRS)
- tuto4 : STACK: how to load and manipulate multilayer rasters (e.g. remote sensing), thresholding multi day, and multi spectral
- tuto5 : COMBINE MULTI-SOURCE DATA - reprojecting rasters, tips and tricks
- tuto6 : INTERACTIVE maps with leaflet, mapview, or tmap

Extra:
- tutoE1 : POLYGON: calculate convex hull, simplify geometries, aggregate, union, etc… spatial influence
- tutoE2 : get data from WMS or WFS
- tutoE3 : spatial autocorrelation - how to measure it, what to do about it? spatial regression model, local regression
- tutoE4 : Krigging and interpolation
- tutoE5 : remote sensing, landsat and modis
- tutoE6 : GoogleEarthEngine, what it is and how to use it (mostly out of R)