varMSAVI2: Calculate the modified soil-adjusted vegetation index...

Description Usage Arguments Details Value References Examples

View source: R/varMSAVI2.R

Description

varMSAVI2 computes the modified soil-adjusted vegetation index 2 (MSAVI2) from the near-infrared (NIR) and red bands.

Usage

1
varMSAVI2(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 modified soil adjusted vegetation index 2 (MSAVI2) is a vegetation indicator that removes the effect from background variations \insertCiteqi1994modifiedRGISTools. This function is used within ls7FolderToVar, ls8FolderToVar, modFolderToVar and senFolderToVar.

Value

A MSAVI2 image in raster format.

References

\insertRef

qi1994modifiedRGISTools

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# 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 MSAVI2 image
img.mod.msavi2 <- varMSAVI2(img.mod.red, img.mod.nir)
# plot the image
spplot(img.mod.msavi2,col.regions=rev(topo.colors(20)))

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