Description Usage Arguments Examples
Compute the area under the curve using linear or natural spline interpolation for two vectors where one corresponds to the x values and the other corresponds to the y values. This function wraps the function from the package "MESS".
1 2 3 4 5 6 7 8 9 10 |
x |
a numeric vector of x values |
y |
a numeric vector of y values of the same length as x |
from |
The value from where to start calculating the area under the curve. Defaults to the smallest x value. |
to |
The value from where to end the calculation of the area under the curve. Defaults to the greatest x value. |
type |
The type of interpolation. Defaults to "linear" for area under the curve for linear interpolation. The value "spline" results in the area under the natural cubic spline interpolation. |
absolutearea |
A logical value that determines if negative areas should be added to the total area under the curve. By default the auc function subtracts areas that have negative y values. Set absolutearea=TRUE to _add_ the absolute value of the negative areas to the total area. |
subdivisions |
an integer telling how many subdivisions should be used for integrate (for non-linear approximations) |
... |
additional arguments passed on to approx (for linear approximations). In particular rule can be set to determine how values outside the range of x is handled. |
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.