R/intg.R

"intg" <-
function(y,x) {
        n <- length(x)
        index <- order(x)
        dx <- diff(sort(x))
        z <- y[index]
        ys <- (z[1:(n-1)]+z[2:n])/2
        sum(ys*dx)
}

Try the PROcess package in your browser

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

PROcess documentation built on Nov. 8, 2020, 5:44 p.m.