Skip to contents

egvtools provides a coherent set of wrappers and utilities that make large-scale EGV creation reproducible and pleasant on real datasets. The package leans on robust building blocks—terra, sf, sfarrow, exactextractr, and whitebox—and standardizes I/O, naming conventions, and multi-scale zonal statistics so your pipelines are repeatable across machines and projects.

Core workflow (generalizable)

Functions that form the backbone of your analyses (thin wrappers over existing libs, but opinionated for stability, speed and consistency):

Reproducibility helpers

Utilities that set up inputs and structure so our (project HiQBioDiv) results can be reproduced:

Design principles

  • Tiled, RAM-aware I/O; workers open data by path (avoid big globals) and caches them if necessary (avoid big I/O).

  • Deterministic filenames and strict layer/radius naming.

  • Guards for empty/invalid geometries, coordinate reference systems, naming and all-NA joins.

  • Cross-platform parallel via {future}/{furrr} when enabled.

Options

Package defaults are set on load (see zzz-options.R). Users may override:

  • options(egvtools.future_plan = "sequential")

  • options(egvtools.progress = TRUE)

  • egvtools.future_plan: default parallel plan name (e.g. "sequential", "multisession").

  • egvtools.progress: logical, show progress bars (TRUE/FALSE).

Getting started

  1. Run download_*_templates() to fetch canonical inputs.

  2. Use tile_vector_grid() / tiled_buffers() for scalable chunks.

  3. Produce EGVs at site scale with polygon2input(), downscale2egv(), distance2egv(), input2egv(), and summarise from larger scales with landscape_function() / radius_function().

Author

Maintainer: Andris Avotiņš andris.avotins@lu.lv