R/trapz.R

Defines functions trapz

trapz <- function(x,y){
  idx = 2:length(x)
  return(as.double((x[idx] - x[idx - 1]) %*% 
                     (y[idx] + y[idx - 1]))/2)
}

Try the afmToolkit package in your browser

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

afmToolkit documentation built on May 1, 2019, 9:20 p.m.