Computation of the area under the curve (AUC), by linear interpolation.
Usage
calc_auc(x, y, limits = NULL)
Arguments
- x
A numeric vector
- y
A numeric vector
- limits
A numeric vector of length 2 (default = range of 'x')
Value
A numeric single value with the computed AUC.
Examples
x <- seq(-3,3,l = 100)
y <- dnorm(x)
plot(x,y)
calc_auc(x,y)
#> [1] 0.9972835