Spatial Data Science
Ressources on spatial analysis and statistics
2024-07-24
Chapter 1 Preface
This book is the main learning resource for the course “Spatial data science” at the University of Heidelberg, Geographisches Institut, in the summer term 2023. Lecturers of the course are Prof. Sven Lautenbach and Marcel Reinmuth. The course was designed in summer term 2022 and adjusted in 2023. Thereby, the content was shortened. Specifically point pattern analysis is no longer part of the teaching session. We also shortened the handling of kriging in the course. Still the content is kept in the course book.
The books content will be complemented and updated - presumably most changes will happen in preparation of and during the summer semester term (mid April till mid July).
During the summer term 2023 the content was slightly extended by additional figures. Also, interpretation of figures and results was expanded in the text - at least at some locations.
1.1 Supporting literature
A number of books use R for spatial data analysis and spatial statistics. These resources help to get deeper insights into the topic of the course. The list might be extended during the time of the course.
Books (online)
- Spatial Data Science (Bivand, n.d.) https://www.r-spatial.org/book
- R for Data Science (Wickham and Grolemund, 2016) https://r4ds.had.co.nz/
- Geospatial Health Data: Modeling and Visualization with R-INLA and Shiny (Moraga, 2019) https://www.paulamoraga.com/book-geospatial/
- Gecomputation with R (Lovelace et al., 2019) https://geocompr.robinlovelace.net/index.html
- Crime Mapping in R by Reka Solymosi and Juanjo Medina https://maczokni.github.io/crime_mapping_textbook/
Books (offline)
- Spatial Point Patterns: Methodology and Applications with R (Baddeley et al., 2015)
- Spatial Regression Analysis Using Eigenvector Spatial Filtering (Griffith et al., 2019)
- Mixed effects models and extensions in ecology with R (Zuur et al., 2009) - as a refresher on regression modelling
1.2 Setting up R & RStudio
R is the programming language. Rstudio is an Integrated Development Interface.
To install R and RStudio choose the installation file that matches your operating system in the links below. Make sure to first install R and Rstudio afterwards. For Rstudio use the free version.
https://cran.r-project.org/ https://www.rstudio.com/products/rstudio/download/
1.3 R libraries for spatial data science
When your R and Rstudio installation is up and running, copy the following chunk to your R console and execute it. The code will check if you have already installed some of the necessary libraries. If not, they will be installed through CRAN. The code checks if the libraries are already installed and installs only missing libraries. Watch for error messages during the installation - sometimes other (external) libraries are missing that might need to be installed separately. Typically the installation should run smooth without problems.
packages <- c("knitr", "tidyverse", "dplyr", "ggplot2", "sf", "s2", "raster", "terra",
"stars", "tmap", "gstat", "spdep", "spatialreg", "spatstat", "foreign",
"ncf", "spgwr", "tripack", "GGally", "corrplot", "dbscan", "moments",
"OpenStreetMap")
install.packages(setdiff(packages, rownames(installed.packages())))