R is where a great deal of environmental and geoscientific statistics happens, and SAGA GIS is where much of the terrain and hydrological preprocessing for that work gets done. Two R packages connect the two programs: RSAGA, the long-standing CRAN package, and Rsagacmd, a newer package built for current SAGA versions. Choosing between them is not a matter of taste — it is a matter of which SAGA version you run, because RSAGA’s documented support stops at SAGA 9.7.2 while SAGA is now at 9.14.0. This guide lays out both packages and the decision table that follows from the facts.
How both packages work
Neither package reimplements SAGA. Both work by driving a SAGA GIS installation from R — under the hood they use SAGA’s command-line interface, the same saga_cmd layer you can call yourself from a terminal. Your R script therefore needs a real SAGA installation beside it: the packages do not bundle SAGA, and the first step in either workflow is installing SAGA from the download page and confirming it runs. In return, you get a single script that does the statistics in R and hands the geoprocessing — terrain parameters, catchment analysis, grid calculations — to SAGA’s specialised tool libraries, with files and objects passed between the two.
RSAGA: established, documented — and capped at SAGA 9.7.2
RSAGA is the veteran. It is published on CRAN, currently at version 1.4.2 (released 1 February 2025), and is maintained by Alexander Brenning, whose name is attached to a large share of the SAGA-in-R literature. Generations of papers and course materials use it, which makes it the easiest route to find examples for.
The constraint is in its own documentation: RSAGA’s stated system requirement is SAGA GIS 2.3 LTS to 9.7.2. That range served well for years, but SAGA has moved on — through 9.12, 9.13 and the current 9.14.0. Pairing RSAGA with a current SAGA means working outside the versions its documentation claims, with no maintainer promise behind the combination. If your project, your course or your collaborators are already standardised on RSAGA with a SAGA inside its documented range, that setup remains perfectly respectable. Starting fresh against a current SAGA is a different calculation.
Rsagacmd: the modern route
Rsagacmd, by Steven Pawley, is the newer package and the one designed around how current SAGA versions work. Its approach is to build R-callable functions from the tools of the SAGA installation it finds on your machine, so the interface follows your SAGA version rather than a frozen snapshot of an old one. For anyone installing SAGA today — which means 9.14.0, with its recent additions — Rsagacmd is the package whose design matches the software you actually have. It also keeps your options open as SAGA continues to release: when SAGA moves, a package that derives its interface from the installed SAGA moves with it.
The decision table
| Your situation | Recommended route |
|---|---|
| SAGA 9.7.2 or older, already working | Either package. RSAGA is within its documented range; Rsagacmd also fits. |
| Current SAGA (9.8 and later, including 9.14.0) | Rsagacmd — RSAGA documents support only up to 9.7.2. |
| Legacy project that must reproduce old results | RSAGA with a period-correct SAGA from the older versions archive, kept in its own folder. |
| Sharing a machine with QGIS / NextGen work | Keep two SAGA installs if needed: a current one for QGIS and Rsagacmd, the pinned one for RSAGA. The troubleshooting guide explains why mixing them up causes failures. |
| No R requirement at all | Skip both — drive SAGA through saga_cmd or PySAGA instead. |
Practical notes
- Install SAGA first, and test it outside R. If a tool will not run from the SAGA GUI or saga_cmd, it will not run from R either. Two minutes of checking there saves an hour of debugging package code that was never the problem.
- Respect the native formats. SAGA grids travel as .sgrd/.sdat file pairs; R-side raster workflows read the .sdat data file. File hygiene — one folder per SAGA version, clear naming — prevents most “R can’t find my SAGA output” episodes.
- Record your versions. A reproducible R script should state the SAGA version it ran against. The gap between “RSAGA with SAGA 9.7” and “Rsagacmd with SAGA 9.14” is exactly the kind of detail that decides whether a colleague can rerun your analysis.
- Don’t strand a working pipeline. If RSAGA and an in-range SAGA are producing results today, upgrading SAGA mid-project to chase a new release is a decision to make deliberately — ideally at a project boundary, with the release notes read first.
Reading older RSAGA literature with current eyes
A large share of the published SAGA-from-R material — journal workflows, university course notes, forum answers — was written in the RSAGA era, when SAGA versions inside its documented range were simply what everyone ran. That material remains valuable for the analysis design it teaches: which terrain attributes to derive, in what order, and how to feed them into statistical models in R. What does not transfer automatically is the setup layer. When a tutorial’s installation instructions assume an old SAGA, translate the workflow rather than the environment: keep the analytical steps, pair them with a current SAGA and Rsagacmd, and verify each tool still exists under the same library in your SAGA’s own documentation. Workflows age gracefully; version assumptions do not.
The short version: RSAGA is a solid, well-documented package whose world ends at SAGA 9.7.2; Rsagacmd is where R users on current SAGA belong. Decide by the SAGA on your disk — and if that SAGA is due an update anyway, let the SAGA in QGIS hub show you everything else a current release unlocks.
