R/funciones.R

Defines functions ndiff

#' Calculate NDVI
#'
#' This function calculates the normalized difference vegetation index.
#'
#' @param b1 value or vector with reflectance in the first wavelenght
#' @param b2 value or vector with reflectance in the second wavelenght
#' @return NDVI value
#' @export

ndiff <- function(b1,b2){
  return((b1-b2)/(b1+b2))
}
rmmarcos/myfirstpackage documentation built on Jan. 12, 2022, 10:46 a.m.