Introduction to Spatial Data in R

Content for Wednesday, August 30, 2023

Now that we’ve covered some of the conceptual bases of spatial data and geographic analysis, it’s time to get started working with actual data in R. Today’s readings and lecture are focused on the basics of getting your data into the R environment and familiarizing yourself with the different components that make up spatial data objects. We’ll do fancier things in the weeks to come!

Readings

Chapter 2 in Geocomputation with R (Lovelace et al. 2019) provides and overview of using sf for vector datasets and terra for raster data.

Chapter 2 from Moraga (2023) explores similar topics, but provides more explanation about projections, coordinates, etc.

Simple Features for R provides a more in-depth, technical discussion of how the sf package organizes spatial data and attributes.

Ch 2.1-2.5 from Spatial Data Science with R and terra describes the basic functionality of terra for both vector and raster datasets. For reasons we’ll discuss in class, we will rarely use terra for vector data.

Objectives

By the end of today, you should be able to:

  1. Read spatial data into your R environment.

  2. Describe the various aspects of spatial data files and objects.

  3. Generate simple summaries describing the spatial data object.

  4. Determine the projection, extent, and resolution of spatial data objects.

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.

View all slides in new window Download PDF of all slides

References

Lovelace, R., J. Nowosad, and J. Muenchow. 2019. Geocomputation with R. CRC Press.