add_vegetation_indices: Add vegetation indices on a IRC image

View source: R/optical_metrics.R

add_vegetation_indicesR Documentation

Add vegetation indices on a IRC image

Description

Computes vegetation indices from the Red, Green and Infra-Red bands of an IRC image and adds them as additional bands or columns. Acronyms are listed on https://www.nv5geospatialsoftware.com/docs/BroadbandGreenness.html. If the Blue band is also present, additional indices are computed.

Usage

add_vegetation_indices(r, all = FALSE, scale = 255)

Arguments

r

raster or data.frame. Should contain bands or columns with names nir, r, g (and b)

all

boolean. indicates whether all indices should be computed; default:FALSE, only grvi, sr and ndvi are calculated

scale

numeric. values in bands are scaled from range [0, scale] to [0, 1]

Value

a raster or data.frame with added bands or columns

Examples

df <- data.frame(nir = c(110, 150, 20),
r = c(25, 50, 30),
g = c(10, 60, 10),
b = c(20, 60, 0))
add_vegetation_indices(df, all = TRUE)

lidaRtRee documentation built on April 3, 2025, 10:29 p.m.