This is a numerical integration of y with respect to x by the trapezoidal method on linear scale.
trapez(x, y, cum = FALSE, na.rm = FALSE)
a numeric
The vector to integrate y with respect to (typically TIME to get area under the curve).
The variable to integrate.
Return the cumulative trapezoidal area under the curve? If false (default) a single number is returned. If true, a vector is returned. Notice, the vector is one element shorter than x and y.
Remove indexes in x and y wherever x or y are NA.