Using Spatial Data with R
Last updated: February 21, 2024
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-spatialin a new folder
Create a new folder under
R-spatialand call it
Open up a new R Script file and call it
R-spatial.Rfor the code you’ll create during the workshop.
If you have your working directory set to
R-spatialwhich contains a folder called
datayou can copy, paste, and run the following lines in R:
You can also download the data manually here R-spatial-data.zip and extract them in the
- Install and load the following libraries:
- For the mapping section install and load these additional libraries:
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
Some of the materials for this tutorial are adapted from http://datacarpentry.org