| internal_trapz | R Documentation |
These are internal helper functions to perform numerical integration
via the trapezoidal rule. The workhorse is internal_trapz(), which
computes the full integral or returns the cumulative integral.
internal_trapz(x, y, return_cumsum = FALSE)
cumtrapz(x, y)
trapz(x, y)
x |
numeric vector of strictly increasing x-values. |
y |
numeric vector of function values at |
return_cumsum |
logical, if |
internal_trapz(x, y, return_cumsum = FALSE):
core implementation
trapz(x, y)
wrapper for internal_trapz(x, y, FALSE), returns the total integral.
cumtrapz(x, y)
wrapper for internal_trapz(x, y, TRUE), returns the cumulative integral.
trapz(): a single numeric value
cumtrapz(): numeric vector of cumulative integrals (starting with 0)
internal_trapz(): either of the above, depending on return_cumsum
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.