area_above | R Documentation |
Calculates the area above the bearing area curve from
points a
to b
. If a box is drawn around
a function with the upper-left at a
and the
bottom-right at b
, this function extracts the area
above the function within the box.
area_above(f, a, b, n = 100)
f |
The function for the Bearing Area curve produced by
|
a |
Numeric. The left x boundary. |
b |
Numeric. The right x boundary. |
n |
Numeric. The number of subdivisions along the function line. |
The area under the curve used to calculate area above the
curve is calculated as the numerical integral
of the Bearing Area function from a
to b
using the trapezoid rule with n subdivisions. Assume
a < b
and n
is a positive integer.
A numeric value representing the area above the curve with
x bounds a
and b
.
# import raster image
data(normforest)
normforest <- terra::unwrap(normforest)
# basic values
z <- terra::values(normforest)
# calculate cumulative probability density function of surface 'height' (= ndvi)
mod <- ecdf((1 - z))
# valley fluid retention index = void volume in 'valley' zone
Svi <- area_above(f = mod, b = 1, a = 0.8, n = 500)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.