
Last chance! 50% off unlimited learning
Sale ends in
AUC(x, y, method = c("trapezoid", "step", "spline"), na.rm = FALSE)
"trapezoid"
(default), "step"
or "spline"
.na.rm
defaults to FALSE
.splinefun
function is used in combination
with integrate
.
The AUC function will handle unsorted x values (by sorting x) and ties for the x values (by ignoring duplicates).integrate
, splinefun
AUC(x=c(1,3), y=c(1,1))
AUC(x=c(1,2,3), y=c(1,2,4), method="trapezoid")
AUC(x=c(1,2,3), y=c(1,2,4), method="step")
plot(x=c(1,2,2.5), y=c(1,2,4), type="l", col="blue", ylim=c(0,4))
lines(x=c(1,2,2.5), y=c(1,2,4), type="s", col="red")
x <- seq(0, pi, length.out=200)
AUC(x=x, y=sin(x))
AUC(x=x, y=sin(x), method="spline")
Run the code above in your browser using DataLab