find_flat: Finds the Flattest Part of the Bearing Area Curve

View source: R/bearingarea.R

find_flatR Documentation

Finds the Flattest Part of the Bearing Area Curve

Description

Locates the flattest x percentage of the Bearing Area curve. Meant to locate the flattest 40 percent of the Bearing Area curve as used in several roughness parameter calculations.

Usage

find_flat(x, perc = 0.4)

Arguments

x

A raster or matrix.

perc

Numeric between 0 and 1. The percentage of the curve over which to fit the line.

Value

A list containing the equation for the best fit line, the predicted values from that line, the high and low y-intercept values for the intersection points of the line with the Bearing Area curve, and the high and low x-intercept values for the intersection points of the line with the Bearing Area curve.

Examples

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

# locate the flattest 40% of the bearing area curve
line_data <- find_flat(normforest, perc = 0.4)

# extract the equation of the line
bf_line <- line_data[[1]]

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