Integrates the peak model over a given range to calculate the area.
Details
A finite x_range is treated as the integration interval for every model. With x_range = NULL, built-in models return their whole-domain area when it is defined. Other models use adaptive numerical integration when a finite interval is supplied.
Examples
model <- create_peak_model("gaussian")
params <- list(height = 1, center = 5, width = 1)
area <- peak_model_area(model, params, c(0, 10))
area
#> [1] 2.506627