trapez: trapezoidal area under the curve on linear scale

View source: R/trapez.R

trapezR Documentation

trapezoidal area under the curve on linear scale

Description

This is a numerical integration of y with respect to x by the trapezoidal method on linear scale.

Usage

trapez(x, y, cum = FALSE, na.rm = FALSE)

Arguments

x

The vector to integrate y with respect to (typically TIME to get area under the curve).

y

The variable to integrate.

cum

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.

na.rm

Remove indexes in x and y wherever x or y are NA.

Value

a numeric


NMcalc documentation built on Sept. 11, 2024, 7:51 p.m.