Many potential ProcessSpace users live in QGIS rather than R. There are three ways to bring the tool to them, in increasing order of effort. The first one already ships with this package.

1. Processing R Provider scripts (available now)

QGIS’s Processing R Provider plugin runs R scripts as regular Processing-toolbox algorithms with auto-generated dialogs — layer pickers, numeric fields, folder browsers.

Setup (one time):

  1. Install R and the ProcessSpace package (remotes::install_github("adamkc/ProcessSpace")).
  2. In QGIS: Plugins → Manage and Install Plugins → Processing R Provider.
  3. In Settings → Options → Processing → Providers → R, confirm the R folder is detected.
  4. Copy the script shipped at system.file("qgis/ProcessSpaceKMZ.rsx", package = "ProcessSpace") into your QGIS R-scripts folder (shown in the same settings panel).

“Process Space KMZ” then appears in the Processing Toolbox: select a stream layer (one contiguous, unbranched path — use Select Features first and run on the selection), point it at a DEM, set the stage levels, and it writes the PDF report and Google Earth KMZ.

Practical notes:

  • The script runs ProcessSpace::processSpace() — anything you can do there can be exposed as another ##param line. Copy and adapt the .rsx for variants (e.g. a detrend-method comparison algorithm calling compareDetrendMethods()).
  • Users need R installed, but never need to see it.

A standalone QGIS plugin could bundle a CLI entry point and call Rscript directly. This buys almost nothing over option 1 (users still need R) and takes on R-discovery and path-quoting fragility across platforms. Skip it.

3. Full PyQGIS port (the long game)

A native plugin with zero R dependency would reach the whole QGIS audience: geometry via PyQGIS/shapely, sampling via GDAL, interpolation via scipy/pykrige (or the nearest-stream-point method, which is trivial in numpy), KML via simplekml, figures via matplotlib. Realistically this is a separate multi-week project that forks the codebase and doubles maintenance.

The sensible sequence: ship option 1, watch whether QGIS-side adoption materializes, and only then consider the port.