calc_NDI_comb: Calculate Normalized Difference Index (NDI) combinations

View source: R/calc_ndi.R

calc_NDI_combR Documentation

Calculate Normalized Difference Index (NDI) combinations

Description

Calculates (all or some) NDI combinations based on an input raster stack with n>1 layers. Combinations are obtained using the combn function (for combinations of n layers, taken 2 at a time).

Usage

calc_NDI_comb(
  rst,
  bandNames = NULL,
  subsetBands = NULL,
  getRstStack = TRUE,
  scale10k = FALSE,
  filename = NULL,
  writeSingleBandRaster = FALSE,
  verbose = TRUE,
  ...
)

Arguments

rst

An input RasterStack object with n > 1 layers.

bandNames

A character vector defining band names (e.g., c("Bl","Gr","Rd","NIR")).

subsetBands

An integer vector defining which bands to be used.

getRstStack

Should the function return a final RasterStack object with all NDI combinations? (default: TRUE) If many layers exist in rst then it is advisable that this option is set to FALSE otherwise lack of memory problems may happen.

scale10k

Should data be scaled/multiplied by a factor of 10000 (default: FALSE). If TRUE then the raster data type is set to "INT4S" (otherwise "FLT4S" is used). Used to prevent out-of-memory problems.

filename

A base filename used to export NDI combinations as a multiband (if writeSingleBandRaster=FALSE) or single-band (if otherwise).

writeSingleBandRaster

If an output filename is defined should each NDI raster be written separetely? (default: FALSE) This is used to save up memory by not having to stack up each NDI raster. If writeSingleBandRaster is set to TRUE then a filename must be defined. The final filename will have the band indices or names as suffix.

verbose

Should the function print out progress messages? (default: TRUE)

...

Additional arguments passed to

Value

A RasterStack object is returned if getRstStack=TRUE.

Author(s)

@joaofgoncalves https://github.com/joaofgoncalves/SegOptim


elpidiofilho/mdsFuncs documentation built on April 14, 2022, 5:40 p.m.