Learn R Programming

lidaRtRee (version 4.0.8)

add_vegetation_indices: 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)

Value

a raster or data.frame with added bands or columns

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]

Examples

Run this code
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)

Run the code above in your browser using DataLab