slope_sinuosity: Calculate slope and sinuosity

View source: R/slope_sinuosity.R

slope_sinuosityR Documentation

Calculate slope and sinuosity

Description

Calculates the slope and sinuosity of the input channel features.

Usage

slope_sinuosity(
  channel_features,
  lead_n,
  lag_n,
  use_smoothing = FALSE,
  loess_span = 0.5,
  vert_units
)

Arguments

channel_features

sf object; a 'fluvgeo' data structure of channel features (i.e., cross section, flowline points, etc.) Must have the following fields: 'ReachName', 'POINT_X', 'POINT_Y', 'POINT_M', 'Z'

lead_n

numeric; The number of features to lead (upstream) to calculate the slope and sinuosity. Must be an integer.

lag_n

numeric; The number of features to lag (downstream) to calculate the slope and sinuosity. Must be an integer.

use_smoothing

boolean; determines if smoothed elevation values are used to calculate gradient. values are: TRUE, FALSE (default)

loess_span

numeric; the loess regression span parameter, defaults to 0.05

vert_units

character; The vertical units. One of: "m" (meter), "ft" (foot), "us-ft" (us survey foot)

Value

A dataframe of slope and sinuosity dimensions representing the position of each feature within the channel.

Examples

# Call the slope_sinuosity function for a flowline
sin_flowline_ss <- slope_sinuosity(fluvgeo::sin_flowline_points_sf,
                                   lead_n = 100, lag_n = 0,
                                   vert_units = "ft")

# Call the slope_sinuosity function for a cross section
sin_riffle_channel_ss <- slope_sinuosity(fluvgeo::sin_riffle_channel_sf,
                                         lead_n = 3, lag_n = 0,
                                         loess_span = 0.5,
                                         vert_units = "ft")


FluvialGeomorph/fluvgeo documentation built on April 12, 2024, 5:35 p.m.