calc_index: Dispatch and Calculate a Named Index

View source: R/calc_indices.R

calc_indexR Documentation

Dispatch and Calculate a Named Index

Description

Dynamically invokes the calculation function for any registered index by name.

Usage

calc_index(index, ...)

Arguments

index

Character string specifying index name (e.g., "NDVI", "SAVI").

...

Named band arguments (e.g., nir = ..., red = ...) and optional index parameters (such as L = 0.5).

Value

A SpatRaster or numeric vector.

Examples

calc_index("NDVI", nir = 0.8, red = 0.2)
calc_index("SAVI", nir = 0.8, red = 0.2, L = 0.5)


GeoIndexR documentation built on Oct. 10, 2026, 5:08 p.m.