The R Spatial Notebook Series
A Guide to Producing Reproducible Social Science Workflows in R
Welcome to the R Spatial Notebook, a collection of interactive code notebooks designed to support researchers, analysts, and data enthusiasts create reproducible spatial workflows in R. These notebooks introduce users to automated data extraction for multiple key social and environmental data sources (including IPUMS, Natural Earth, OSM, and many others), data cleaning and integration for both tabular and spatial data, foundational and advanced spatial tools and workflows, and mapping tips and techniques - all using R.
The notebook series is designed to be used like a book with earlier chapters providing foundational concepts and workflows necessary to complete later chapters. However, each notebook is also a standalone resource and designed to be downloaded and modified to support the user’s specific research and education needs.
Whether you’re new to spatial data science looking for a place to get started or an experience R coder looking to expand your existing workflows, these notebooks are designed to support your journey in understanding and applying spatial methodologies with R.
Receive Project Updates
The R Spatial Notebooks Series is an ongoing project with new notebooks currently in development. Sign up for the R Spatial Mailing List to receive project updates, new notebook announcements, and opportunities to connect.
Make a Suggestion
Do you have a specific topic or notebook idea you would like to see included in the R Spatial Notebooks? Drop a message in the suggestion box!.
Upcoming Webinars and Past Webinar Recordings
- recording coming soon April 9, 2025 Automating IPUMS USA Data Extraction and Management Workflows in R
- January 15, 2025 Introducing the R Spatial Notebook Series: Supporting Reproducible Geospatial Analysis for the Social Sciences in R
More Information
- April 4, 2025 IPUMS Blog Article Unlocking Spatial and Social Data with R: Introducing the R Spatial Notebook Series
R Spatial Notebooks Chapter List
Chapter 1: Data Sources and APIs
- 1.1 Introduction to IPUMS and the IPUMS API
- 1.2 Introduciton to Natural Earth
- 1.3 Introduction to OpenStreetMap (OSM) - coming soon: release 2
- 1.4 Introduction to Stadia Maps and Stamen Maps - coming soon: release 3
- 1.5 Introduction to Google Maps - coming soon: release 3
- 1.6 Introduction to the National Land Cover Database (NLCD) - coming soon: release 4
Chapter 2: Fundamentals of Spatial Data
- 2.1 Introduction to sf: Reading, Writing, and Inspecting Vector Data
- 2.2 Working with CRS: Reprojection and Transformation
- 2.3 Preparing Vector Data for Analysis
- 2.4 Introduction to terra: Reading, Writing, and Inspecting Raster Data - coming soon: release 4
Chapter 3: IPUMS Data Acquisition and Extraction
- 3.1 IPUMS USA Data Extraction Using ipumsr
- 3.2 IPUMS NHGIS Data Extraction Using ipumsr
- 3.3 IPUMS CPS Data Extraction Using ipumsr - coming soon
Chapter 4: Open-Source GIS Data Acquisition and Extraction
- 4.1 Importing Data from Natural Earth with rnaturalearth and rnaturalearthdata
- 4.2 Importing Data from OpenStreetMap (OSM) with osmdata - coming soon: release 2
Chapter 5: Data Cleaning, Preparation, and Exploratory Data Analysis (EDA)
- 5.1 Data Cleaning and Preparation with IPUMS USA
- 5.2 Exploratory Data Analysis (EDA) with IPUMS USA
- 5.3 Spatial Data Exploration and Preprocessing with IPUMS NHGIS
Chapter 6: Mapping and Visualization
- 6.1 Visualization and Quick Plots
- 6.2 Mapping Point and Polygon Data
- 6.3 Choropleth Mapping
- 6.4 Importing Basemaps from OpenStreetMap (OSM) with rosm - coming soon: release 2
- 6.5 Importing Basemaps from OpenStreetMap (OSM) with ggspatial - coming soon: release 2
- 6.6 Importing Basemaps from OpenStreetMap (OSM), Stadia Maps, Stamen Maps, and Google Maps with ggmap - coming soon: release 3
- 6.7 Importing Local Basemap Files with terra - coming soon: release 4
- 6.8 Interactive Mapping with Leaftlet - coming soon: release 3
- 6.9 Interactive Mapping with Shiny - coming soon: release 3
Chapter 7: Foundational Spatial Analyses
- 7.1 Geometric Binary Predicates: The Building Blocks of Geometric Queries
- 7.2 Spatial Joins and Filter by Location
- 7.3 Distance and Nearest Neighbor Calculations
- 7.4 Buffer Analysis - coming soon
Chapter 8: Advanced Spatial Analyses
Coming Soon! Sign up for the R Spatial Mailing List to receive project updates!
Chapter 9: Raster Analysis
- 8.1 Raster Analysis and Aggregation - coming soon: release 4
- 8.2 Raster Data Mapping and Visualization - coming soon: release 4
Project FAQs
Why is everything written in Jupyter Notebooks rather than R Markdown? This project was started while I was a postdoctoral scholar with the University of Minnesota and the NSF I-GUIDE project and the notebooks were specifically developed to be used and shared witin the I-GUDE platform. The I-GUIDE platform supports the Jupyter Notebook framework which is why I wrote the notebooks in Jupyter rather than R Markdown. I may write and make available R Markdown versions in the future if there is interest for it.