varNDVI: Calculate the normalized difference vegetation index (NDVI)

Description Usage Arguments Details Value References Examples

View source: R/varNDVI.R

Description

varNDVI computes the normalized difference vegetation index (NDVI) from the red an near-infrared (NIR) bands.

Usage

1
varNDVI(red, nir)

Arguments

red

a raster with the red band of the capture.

nir

a raster with the NIR band of the capture.

Details

The normalized difference vegetation index (NDVI) is the most widely used index for monitoring vegetation dynamics. The NDVI reflects the vegetation vigour and it is closely related to the amount of photosynthetically active radiation absorbed \insertCiterouse1972monitoringRGISTools. This function is used within ls7FolderToVar, ls8FolderToVar, modFolderToVar and senFolderToVar.

Value

A NDVI image in raster format.

References

\insertRef

rouse1972monitoringRGISTools

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# path to the cropped and cutted MODIS images for the region of Navarre
wdir <- system.file("ExNavarreVar", package = "RGISTools")
# list all the tif files
files.mod <- list.files(wdir, pattern="\\.tif$", recursive = TRUE, full.names = TRUE)
# print the MOD09 bands
getRGISToolsOpt("MOD09BANDS")

# select the red and NIR bands
img.mod.red <- raster(files.mod[1])
img.mod.nir <- raster(files.mod[2])
# calculate the NDVI image
img.mod.ndvi <- varNDVI(img.mod.red,img.mod.nir)
# plot the image
spplot(img.mod.ndvi,col.regions=rev(terrain.colors(20)))

RGISTools documentation built on July 2, 2020, 3:58 a.m.