R/getMaxNegSlope.R

Defines functions getMaxNegSlope

Documented in getMaxNegSlope

getMaxNegSlope <-
function(timSerVals) {
  diffTimSerVals <- diff(timSerVals)
  maxNegSlope <- NULL
  if (any(diffTimSerVals < 0)) {
    negDiffTimSerVals <- diffTimSerVals[which(diffTimSerVals < 0)]
    maxNegSlope <- min(negDiffTimSerVals, na.rm = TRUE)
  }
  maxNegSlope
}

Try the KarsTS package in your browser

Any scripts or data that you put into this service are public.

KarsTS documentation built on Jan. 16, 2021, 5:07 p.m.