// the find
geocompx/geocompr
Geocomputation with R: an open source book
Geocomputation with R is a full-length open-source textbook covering spatial data manipulation, visualization, and analysis in R using the sf, terra, and tmap packages. It's for data scientists and geographers who want to do serious GIS work in R instead of ArcGIS or QGIS. The second edition (2025) is current and published by CRC Press.
Coverage of the sf/terra transition from the old sp/raster stack is thorough — this is the thing that trips up most people coming from older tutorials. The DE-9IM section and binary spatial predicates chapter fill a gap that most R spatial tutorials skip entirely. Binder + devcontainer setup means you can actually run the code without wrestling with GDAL/GEOS system dependencies on your local machine. The mlr3 chapter on spatial cross-validation is one of the few places this topic is explained properly for R users.
The build toolchain is heavy — you need bookdown, a full R package install from a custom r-universe, and native GDAL/GEOS/PROJ libraries. Getting it to build locally on Windows is a real fight, and the README mostly assumes Linux. The tmap v4 migration is recent enough that code examples in older blog posts and Stack Overflow answers will contradict what's in the book, which confuses beginners. Chapters 13–15 (transport, location analysis, ecology) are considerably more domain-specific than the rest of the book, and someone just learning spatial R will get lost without that background.