R/peakAreaCalculator.R

Defines functions peakAreaCalculator

Documented in peakAreaCalculator

peakAreaCalculator <- function(x, y) {
  PA <- do.call(sum, lapply(1:(length(x) - 1), function(i) {
    (x[i + 1] - x[i])*(y[i + 1] + y[i])
  }))/2
  ##
  return(PA)
}

Try the IDSL.IPA package in your browser

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

IDSL.IPA documentation built on June 7, 2023, 6:01 p.m.