Using Spatial Data with R
Last updated: February 11, 2019
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.
Recommended:
Create a new RStudio project
R-spatial
in a new folderR-spatial
.Create a new folder under
R-spatial
and call itdata
.If you have your working directory set to
R-spatial
which contains a folder calleddata
you can copy, paste, and run the following lines in R:
download.file("http://bit.ly/R-spatial-data", "R-spatial-data.zip")
unzip("R-spatial-data.zip", exdir = "data")
You can also download the data manually here R-spatial-data.zip and extract them.
Open up a new R Script file
R-spatial.R
for the code you’ll create during the workshop.- Install and load the following libraries:
- For the mapping section install and load these additional libraries:
References
Bivand, RS., Pebesma, E., Gómez-Rubio, V. (2013): Applied Spatial Data Analysis with R
Brunsdon, C. and Comber, L. (2015): An Introduction to R for Spatial Analysis and Mapping
Lovelace, R., Nowosad, J., Muenchow. J. (2019): Geocomputation with R
Spatial Data Analysis and Modeling with R
CRAN Task View: Analysis of Spatial Data
Engel, C. (2019). R for Geospatial Analysis and Mapping. The Geographic Information Science & Technology Body of Knowledge (1st Quarter 2019 Edition), John P. Wilson (Ed.). DOI:10.22224/gistbok/2019.1.3.
For a quick introduction to all things geo check out map school.
Acknowledgements
Some of the materials for this tutorial are adapted from http://datacarpentry.org