Skip to contents

Installation

Install rfp from GitHub:

pak::pak("NewGraphEnvironment/rfp")

System dependencies

rfp wraps command-line tools for spatial data processing and field project management. These need to be installed separately.

GDAL

GDAL provides ogr2ogr for vector data conversion. It’s also required by R’s sf package.

# macOS
brew install gdal

# Linux (Debian/Ubuntu)
apt install gdal-bin

Python CLI tools

rfp manages Python tools (bcdata, fiona, rasterio, mergin-client) via uv. Install uv, then sync the package’s Python environment:

pip install uv
uv sync --project "$(Rscript -e 'cat(system.file("python", package = "rfp"))')"

Docker

rfp uses Docker for headless QGIS operations (style application, map rendering). Install Docker Desktop from docker.com.

The first time you run a style or rendering function, Docker will pull the qgis/qgis image (~2 GB). Subsequent runs use the cached image.

Verify dependencies

Check that everything is available:

library(rfp)
rfp_check_deps()
#> ✔ ogr2ogr
#> ✔ bcdata
#> ✔ fio
#> ✔ rio
#> ✔ mergin
#> ✔ docker
#> ✔ All external dependencies found.

Mergin Maps authentication

To push projects to Mergin Maps for mobile field collection, set your credentials as environment variables. Add these to your ~/.Renviron:

MERGIN_USERNAME=your_username
MERGIN_PASSWORD=your_password

Or use a bearer token:

MERGIN_AUTH=Bearer your_token_here

Get a token by running mergin login in a terminal with the uv venv activated.