Appendix A: Packages used

A.1 s2

Package Profile: S2


Spherical Geometry Operators Using the S2 Geometry Library (Dunnington, Pebesma, and Rubak 2024)

(There is no hexagon sticker available for {S2}.)

Provides R bindings for Google’s s2 library for geometric calculations on the sphere. High-performance constructors and exporters provide high compatibility with existing spatial packages, transformers construct new geometries from existing geometries, predicates provide a means to select geometries based on spatial relationships, and accessors extract information about geometries.

S2 is perhaps best known as an example of a Discrete Global Grid System (DGGS)


A.2 sf

Package Profile: sf


Simple Features for R (Pebesma and Bivand 2023a)

Support for simple features, a standardized way to encode spatial vector data. Binds to ‘GDAL’ for reading and writing data, to ‘GEOS’ for geometrical operations, and to ‘PROJ’ for projection conversions and datum transformations. Uses by default the ‘s2’ package for spherical geometry operations on ellipsoidal (long/lat) coordinates.


Note A.1: {sf} is now the go-to package for analysis of spatial vector data in R

Simple feature objects in R are stored in a data frame, with geographic data occupying a special column, usually named ‘geom’ or ‘geometry’. Simple features are, in essence, data frames with a spatial extension.

{sf} provides the same functionality (and more) previously provided in three (now deprecated) packages:

  • {sp} for data classes
  • {rgdal} for data read/write via an interface to GDAL and PROJ and
  • {rgeos} for spatial operations via an interface to GEOS.

Most of the book notes are a tutorial how to use the {sf} package. I will therefore abstain here from additonal comments.

A.3 sfheaders

Package Profile: sfheaders


Converts Between R Objects and Simple Feature Objects (Cooley 2024)

(There is no hexagon sticker available for {sfheaders}.)

Converts between R and Simple Feature sf objects, without depending on the ‘heavy’ Simple Feature library. Conversion functions are available at both the R level, and through {Rcpp}.

A.4 stars

Package Profile: stars


Spatiotemporal Arrays, Raster and Vector Data Cubes (Pebesma and Bivand 2023b)

(There is no hexagon sticker available for {Package}.)

Reading, manipulating, writing and plotting spatiotemporal arrays (raster and vector data cubes) in ‘R’, using GDAL bindings provided by {sf}, and NetCDF bindings by {ncmeta} and {RNetCDF}.


Read (Pebesma and Bivand 2023c) to learn more about {stars}.

A.5 terra

Package Profile: terra


Spatial Data Analysis (Robert J. Hijmans 2025b)

Methods for spatial data analysis with vector (points, lines, polygons) and raster (grid) data. Methods for vector data include geometric operations such as intersect and buffer. Raster methods include local, focal, global, zonal and geometric operations. The predict and interpolate methods facilitate the use of regression type (interpolation, machine learning) models for spatial prediction, including with satellite remote sensing data. Processing of very large files is supported.


Note

{terra} replaces the {raster} package ({terra} can do more, and it is faster and easier to use).

A.6 units

Package Profile: units


Measurement Units for R Vectors (Pebesma, Mailund, and Hiebert 2016a)

(There is no hexagon sticker available for {units}.)

Support for measurement units in R vectors, matrices and arrays: automatic propagation, conversion, derivation and simplification of units; raising errors in case of unit incompatibility. Compatible with the POSIXct, Date and difftime classes. Uses the UNIDATA udunits library and unit database for unit compatibility checking and conversion. Documentation about ‘units’ is provided in the paper by (Pebesma, Mailund, and Hiebert 2016b) included as package vignette.


References

Cooley, David. 2024. “Sfheaders: Converts Between r Objects and Simple Feature Objects.” https://CRAN.R-project.org/package=sfheaders.
Dunnington, Dewey, Edzer Pebesma, and Ege Rubak. 2024. “S2: Spherical Geometry Operators Using the S2 Geometry Library.” https://CRAN.R-project.org/package=s2.
Hijmans, Robert J. 2023. “The Terra Package,” November. https://rspatial.org/pkg/terraPackage.pdf.
———. 2025a. “Spatial Data Science with r and Terra.” https://rspatial.org/.
Hijmans, Robert J. 2025b. “Terra: Spatial Data Analysis.” https://CRAN.R-project.org/package=terra.
Pebesma, Edzer, and Roger Bivand. 2023a. Spatial Data Science: With Applications in r.” https://doi.org/10.1201/9780429459016.
———. 2023b. Spatial Data Science: With Applications in r,” 352. https://doi.org/10.1201/9780429459016.
———. 2023c. Spatial Data Science: With Applications in R. 1st ed. Boca Raton London New York: CRC Press.
Pebesma, Edzer, Thomas Mailund, and James Hiebert. 2016a. “Measurement Units in r 8. https://doi.org/10.32614/RJ-2016-061.
———. 2016b. “Measurement Units in R.” The R Journal 8 (2): 486–94. https://journal.r-project.org/archive/2016/RJ-2016-061/index.html.