Integrating Rasters and Vector Data
Content for Monday, October 16, 2023
The goal of much of our spatial data “munging” is to create a dataframe that can be used in subsequent statistical analyses. It can be difficult to link all of the steps of filtering, selecting, extracting, etc into a coherent problem when you are just being exposed to the syntax (as we discovered last week). Today, I’ll try to use a motivating example to help you see a path forward.
Resources
The Spatial Data Operations Chapter in (Lovelace et al. 2019) makes the concepts of a network concrete (literally) by using a transportation route example to illustrate the various components of a network analysis in
R
.Chapter 3. Processing Tabular Data from Geographic Data Science with R by Michael C. Wimberly has a nice introduction to many of the
dplyr
verbs for manipulating tabular data.Chapter 9. Combining Vector Data with Continuous Raster Data from Geographic Data Science with R by Michael C. Wimberly introduces data extraction and zonal statistics for raster data.
Chapter 10. Combining Vector Data with Discrete Raster Data from Geographic Data Science with R by Michael C. Wimberly extends Chapter 9 for discrete rasters, but also adds some additional buffering and data manipulation syntax.
Objectives
By the end of today you should be able to:
Use
dplyr
withpredicates
andmeasures
to subset and manipulate dataUse
extract
to access raster dataUse
zonal
to summarize access dataJoin data into a single analyzable dataframe
Slides
The slides for today’s lesson are available online as an HTML file. Use the buttons below to open the slides either as an interactive website or as a static PDF (for printing or storing for later). You can also click in the slides below and navigate through them with your left and right arrow keys.