Skip to contents

Convenience wrapper that projects a single niche (mu, Sigma) onto a geographic raster using xnicher's habitat-suitability engine.

Usage

project_single_niche(
  mu,
  Sigma,
  env,
  output = "",
  overwrite = FALSE,
  return_log = FALSE,
  threads = NULL
)

Arguments

mu

Numeric vector of length P, niche centroid.

Sigma

Symmetric positive-definite P x P matrix.

env

A multi-layer SpatRaster from terra, with one layer per environmental variable.

output

Character. File path for output GeoTIFF. If "" (default), returns an in-memory SpatRaster.

overwrite

Logical. Whether to overwrite existing output file.

return_log

Logical. If FALSE (default), returns suitability \(S(x) \in (0, 1]\). If TRUE, returns log-suitability \(\log S(x) \le 0\).

threads

Integer. Number of parallel threads for the C++ kernel.

Value

A one-layer SpatRaster named "suitability" (or "log_suitability" when return_log = TRUE).