Area_Under_Curve: Calculate the Area Under the Curve

View source: R/Utils.R

Area_Under_CurveR Documentation

Calculate the Area Under the Curve

Description

Calculate the area under the curve.

Usage

Area_Under_Curve(x, y, method = c("trapezoid", "step", "spline"),
  na.rm = FALSE)

Arguments

x

the x-points of the curve

y

the y-points of the curve

method

can be "trapezoid" (default), "step" or "spline"

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds

Value

Area Under the Curve (AUC)

Examples

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)

MLmetrics documentation built on May 29, 2024, 9:34 a.m.