get_streams: Extract portions of the stream network for river long-profile...

View source: R/dem_processing.R

get_streamsR Documentation

Extract portions of the stream network for river long-profile analysis

Description

Get ids for all streams segments moving up (default) or down from a starting stream segment (identified with 'id'). Follow the largest accumulation tributary at confluences when moving upstream.

Usage

get_streams(net, id, mode = "up")

Arguments

net

stream network from 'get_network' (SpatVector)

id

id of the starting stream segment (integer)

mode

type of extraction : upstream from id ('up', default), upstream including all tributaries ('up_all') or downstream from id ('down').

Value

If 'mode' is 'up' (default) returns a vector with the upstream ids. If 'mode' is 'up_all' returns a dataframe with the first line corresponding to the main stream, and following lines to tributaries. The column 'ids' contains the ids of the stream segments, 'length' the total length of the stream and 'n' the number of segments. If 'mode' is 'down' returns a vector with the downstream ids.


VincentGodard/gtbox documentation built on Sept. 4, 2022, 3:46 a.m.