powered by
Calculate the area under the curve.
Area_Under_Curve(x, y, method = c("trapezoid", "step", "spline"), na.rm = FALSE)
Area Under the Curve (AUC)
the x-points of the curve
the y-points of the curve
can be "trapezoid" (default), "step" or "spline"
a logical value indicating whether NA values should be stripped before the computation proceeds
x <- seq(0, pi, length.out = 200) plot(x = x, y = sin(x), type = "l") Area_Under_Curve(x = x, y = sin(x), method = "trapezoid", na.rm = TRUE)
Run the code above in your browser using DataLab