Description Usage Arguments Details Value Author(s) Examples
This function calculates the NDVI for the given extent based on remotely sensed reflectance values for Red and Near Infared (NIR) bands. The function removes any NA and negative values, and multiplies NDVI values by 10000.
1 |
NIRstack |
RasterStack or RasterBrick with the remotely sensed Near Infared (NIR) band reflectance values. Must have corresponding layers with REDstack input. |
REDstack |
RasterStack or RasterBrick with the remotely sensed visible red band reflectance values. Must have corresponding layers with NIRstack input. |
NAValue |
value to be set as NA in input layers |
scalefactor |
factor to scale NDVI output by |
filename |
Character. Output filename (optional) |
... |
additional arguments for writing files as in writeRaster |
It is important to perform any spatial resizing of reflectance data prior to running this function.
RasterBrick
Sydney M Firmin
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ##load in NIR Reflectance Stack
##data("MODIS_NIR")
##load in Red Reflectance Stack
##data("MODIS_Red")
##aggregate reflectance layers and resample to match final output prior to calculating NDVI
##MODIS_NIR_ag <- aggregate(MODIS_NIR, fact=9, fun=mean, expand=TRUE)
##MODIS_NIR_rs <- resample(MODIS_NIR_ag, CO_C3Crop, method="bilinear")
##MODIS_Red_ag <- aggregate(MODIS_Red, fact=9, fun=mean, expand=TRUE)
##MODIS_Red_rs <- resample(MODIS_Red_ag, CO_C3Crop, method="bilinear")
##calculate NDVI removing NA and Negative values, multiplied by 10000
##NDVI <- NDVI(NIRstack=MODIS_NIR_rs, REDstack=MODIS_Red_rs,
##=-1000, scalefactor=10000, nlayers=12, filename="NDVI")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.