R/integrate.mstR.R

integrate.mstR<-function (x, y) 
{
    hauteur <- x[2:length(x)] - x[1:(length(x) - 1)]
    base <- apply(cbind(y[1:(length(y) - 1)], y[2:length(y)]), 
        1, mean)
    res <- sum(base * hauteur)
    return(res)
}

Try the mstR package in your browser

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

mstR documentation built on May 2, 2019, 8:28 a.m.