trapez {NMcalc}R 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


[Package NMcalc version 0.0.3 Index]