| vc_area | R Documentation |
Compute geometric area between two graphs
vc_area(
f,
interval,
g = NULL,
breaks = NULL,
method = c("adaptive", "trapezoid", "simpson"),
n = 32L,
abs_tol = 1e-08,
rel_tol = 1e-08,
subdivisions = 100L
)
f |
Deterministic function accepting a real scalar and returning one finite real scalar. Vectorization is not required. |
interval |
Two finite real bounds, allowing reversed or equal bounds. |
g |
Second scalar boundary function; NULL means zero. |
breaks |
Optional finite strictly increasing interior integration split points, for example known intersections. These are not found automatically. |
method |
Quadrature rule: trapezoid, Simpson, or adaptive QUADPACK through stats::integrate(). Improper infinite bounds are not supported. |
n |
Initial number of equal cells for fixed rules; positive integer, even and at least two for Simpson. Ignored by the adaptive rule. |
abs_tol, rel_tol |
Nonnegative finite absolute and relative diagnostic tolerances; at least one must be positive. Adaptive integration also applies the tolerance restrictions of stats::integrate(). |
subdivisions |
Positive integer maximum adaptive subinterval count; ignored by fixed rules. |
Integrates abs(f-g), not abs(integral(f-g)). Curve ordering may
change. Bounds are sorted because area is unoriented; equal bounds give
zero. Sampled values and totals must be finite. Known crossings can be
supplied as breaks to help resolve the nonsmooth absolute difference.
Finite sampling does not prove all crossings or features were resolved.
Plain list with type, sorted interval, breaks, method, estimate (geometric area), signed_estimate (integral of f-g on increasing bounds), area and signed (complete segmented quadrature diagnostics), and note.
identity |> vc_area(c(-1,1),breaks=0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.