Prerequisites and Preparations

To get the most out of this workshop you should have:

  • a basic knowledge of R and/or be familiar with the topics covered in the Introduction to R.
  • have a recent version of R and RStudio installed.


  • Create a new RStudio project R-spatial in a new folder R-spatial.

  • Create a new folder under R-spatial and call it data.

  • Open up a new R Script file and call it R-spatial.R for the code you’ll create during the workshop.

  • If you have your working directory set to R-spatial which contains a folder called data you can copy, paste, and run the following lines in R:

download.file("", "")
unzip("", exdir = "data")

You can also download the data manually here and extract them in the data folder.


Lovelace, R., Nowosad, J., Muenchow. J. (2024): Geocomputation with R

Pebesma, E. Bivand, R. (2023): Spatial Data Science

Gimond, M (2023): Intro to GIS and Spatial Analysis

Spatial Data Analysis and Modeling with R and terra

CRAN Task View: Analysis of Spatial Data


Some of the materials for this tutorial are adapted from