slopemeans: Determines the Average Slope Along Larger Segments of the...

View source: R/bestfit.R

slopemeansR Documentation

Determines the Average Slope Along Larger Segments of the Bearing Area Curve

Description

Calculates the average slope over every segment of a specified percentage length of the total bearing area curve.

Usage

slopemeans(slopes, l = 0.4)

Arguments

slopes

A dataframe containing all slopes along the bearing area curve, calculated using the slopecalc function.

l

Percentage of the curve over which to calculate mean slope.

Value

A dataframe with the average slope over segments beginning at specified x locations along the bearing area curve. 'slope' represents the mean slope over the segment, 'xstart' is the beginning x location of the segment, and 'xend' is the concluding x location of the segment.

Examples

# import raster image
data(normforest)
normforest <- terra::unwrap(normforest)

# find the average slope of segments of the bearing area
# curve.
ba <- bearing_area(normforest)
x <- seq(0, 1, length.out = 10000)
slopes <- slopecalc(x = x, h = 0.01, f = ba)
slopes_forty <- slopemeans(slopes = slopes, l = 0.4)

geodiv documentation built on Oct. 6, 2023, 1:07 a.m.