ndvi2 {visa} | R Documentation |
Calculate and plot a 2-band NDVI.
Description
This function calculates a 2-band NDVI using the nsr
function.
Usage
ndvi2(s, b1, b2)
Arguments
s |
Spectral data in the format of visa's Spectra object, spectra.data.frame or spectra.matrix. |
b1 |
A integer number which defines the wavelength of the 1st spectral band. |
b2 |
A integer number which defines the wavelength of the 2nd spectral band. |
Details
Calculate a NDVI with two specific bands of choice. The new NDVI follows the the standard formula
NDVI = (\lambda_i + \lambda_j)/(\lambda_i - \lambda_j)
. Bands i and j correspond to the b1 and b2 input arguments, respectively. Wavelength indexes are determined based on the first argument 's'.
Value
ndvi |
The returned values are the new NDVI. |
Examples
library(visa)
s <- NSpec.DF$spectra
ndvi2(s, 780, 680)
[Package visa version 0.1.0 Index]