Geocompr
Geocomputation with R: an open source book
Install / Use
/learn @geocompx/GeocomprREADME
Geocomputation with R
<!-- badges: start --> <!-- [](https://zenodo.org/badge/latestdoi/84222786) --> <!-- badges: end -->Introduction
This repository hosts the code underlying Geocomputation with R, a book by Robin Lovelace, Jakub Nowosad, and Jannes Muenchow. If you find the contents useful, please cite it as follows:
Lovelace, Robin, Jakub Nowosad and Jannes Muenchow (2025). Geocomputation with R. The R Series. CRC Press.
To learn more about the second edition of the book, see the “Second edition of Geocomputation with R is complete” blog post.
The first version of the book has been published by CRC Press in the R Series and can be viewed online at bookdown.org. Read the latest version at r.geocompx.org.
<!-- ### Note: we are actively working on the Second Edition 🏗 <details> <summary>Summary of the changes</summary> Since commencing work on the Second Edition in September 2021 much has changed, including: - Replacement of `raster` with `terra` in Chapters 1 to 7 (see commits related to this update [here](https://github.com/geocompx/geocompr/search?q=terra&type=commits)) - Update of Chapter 7 to include mention alternative ways or reading-in OSM data in [#656](https://github.com/geocompx/geocompr/pull/656) - Refactor build settings so the book builds on Docker images in the [geocompr/docker](https://github.com/geocompx/docker) repo - Improve the experience of using the book in Binder (ideal for trying out the code before installing or updating the necessary R packages), as documented in issue [#691](https://github.com/geocompx/geocompr/issues/691) (thanks to [yuvipanda](https://github.com/yuvipanda)) - Improved communication of binary spatial predicates in Chapter 4 (see [#675](https://github.com/geocompx/geocompr/pull/675)) - New section on the links between subsetting and clipping (see [#698](https://github.com/geocompx/geocompr/pull/698)) in Chapter 5 - New [section](https://r.geocompx.org/spatial-operations.html#de-9im-strings) on the dimensionally extended 9-intersection model (DE-9IM) - New [chapter](https://r.geocompx.org/raster-vector.html) on raster-vector interactions split out from Chapter 5 - New [section](https://r.geocompx.org/spatial-class.html#the-sfheaders-package) on the **sfheaders** package - New [section](https://r.geocompx.org/spatial-class.html#s2) in Chapter 2 on spherical geometry engines and the **s2** package - Replacement of code based on the old **mlr** package with code based on the new **mlr3** package, as described in a huge [pull request](https://github.com/geocompx/geocompr/pull/771) - Adaptation to changes in the PROJ library, using WKT2 and SRID format for defining coordinate reference systems - Update to most figures using version 4 of the **tmap** package, with a different syntax and new features for improved customization and aesthetics - Several new graphs to enhance understanding, such as one illustrating the process of creating an `sf` object - Rewritten and expanded the "Bridges to GIS software" chapter, including new packages like **qgisprocess**, **Rsagacmd**, and **rgrass** - Rewritten the "Transportation" chapter, introducing new sections on routes and route networks - New book parts related to the creation of geographic metadata and connecting R with cloud services <!-- Todo: update this bullet point (Rl 2023-03) --> <!-- Todo: add news file? (RL 2021-11) --> <!-- See NEWS.md for a summary of the changes. --> <!-- See [https://github.com/geocompx/geocompr/compare/1.9...main](https://github.com/geocompx/geocompr/compare/1.9...main#files_bucket) for a continuously updated summary of the changes to date. This shows 20k+ lines of code/prose added, lots of refactoring! </details> -->Contributions are very welcome.
Contributing
We encourage contributions on any part of the book, including:
- improvements to the text, e.g., clarifying unclear sentences, fixing typos (see guidance from Yihui Xie);
- changes to the code, e.g., to do things in a more efficient way;
- suggestions on content (see the project’s issue tracker);
- improvements to and alternative approaches in the Geocompr solutions booklet hosted at r.geocompx.org/solutions (see a blog post on how to update solutions in files such as _01-ex.Rmd here)
See our-style.md for the book’s style.
Many thanks to all contributors to the book so far via GitHub (this list will update automatically): prosoitos, tibbles-and-tribbles, florisvdh, babayoshihiko, katygregg, Lvulis, rsbivand, iod-ine, KiranmayiV, cuixueqin, defuneste, smkerr, zmbc, marcosci, darrellcarvalho, dcooley, FlorentBedecarratsNM, erstearns, appelmar, MikeJohnPage, eyesofbambi, krystof236, nickbearman, tylerlittlefield, sdesabbata, howardbaik, edzer, pat-s, giocomai, KHwong12, LaurieLBaker, eblondel, MarHer90, mdsumner, ahmohil, richfitz, VLucet, wdearden, yihui, adambhouston, chihinl, cshancock, e-clin, ec-nebi, gregor-d, jasongrahn, p-kono, pokyah, schuetzingit, tim-salabim, tszberkowitz, vlarmet, ateucher, annakrystalli, andtheWings, kant, gavinsimpson, Himanshuteli, yutannihilation, jimr1603, jbixon13, jkennedyie, olyerickson, yvkschaefer, katiejolly, kwhkim, layik, mpaulacaldas, mtennekes, mvl22, ganes1410.
During the project we aim to contribute ‘upstream’ to the packages that
make geocomputation with R possible. This impact is recorded in
our-impact.csv.
Downloading the source code
The recommended way to get the source code underlying Geocomputation with R on your computer is by cloning the repo. You can can that on any computer with Git installed with the following command:
git clone https://github.com/geocompx/geocompr.git
An alternative approach, which we recommend for people who want to
contribute to open source projects hosted on GitHub, is to install the
[gh CLI tool](https://github
Related Skills
best-practices-researcher
The most comprehensive Claude Code skills registry | Web Search: https://skills-registry-web.vercel.app
mentoring-juniors
Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.
groundhog
399Groundhog's primary purpose is to teach people how Cursor and all these other coding agents work under the hood. If you understand how these coding assistants work from first principles, then you can drive these tools harder (or perhaps make your own!).
isf-agent
a repo for an agent that helps researchers apply for isf funding

