alldownstream: Return a vector of all subcatchments downstream of a...

View source: R/alldownstream.R

alldownstreamR Documentation

Return a vector of all subcatchments downstream of a specified catchment

Description

Return a vector of all subcatchments downstream of a specified catchment

Usage

alldownstream(hierarchy, catchname)

Arguments

hierarchy

a dataframe containing catchment id and next downstream (nextds) id fields

catchname

a dataframe containing catchment id for which a vector of downstream catchment ids will be returned.

Value

a vector of downstream catchment ids

Note

Function depends on the next downstream field in a stream network 'hierarchy' table (dataframe). When used in conjunction with list_all_downstream it is possible to get a list of catchments downstream of a vector of sites. This can then be used to support further aggregation of environmental variables for sub-catchments downstream of a list of catchments of interest (e.g. for calculating barrier numbers).

Examples


#find all sites downstream of the first site in the catchment list
data(mwcats)

alldownstream(hierarchy = mwcats, catchname = mwcats$site[1])

nickbond/catchstats documentation built on July 10, 2024, 9:56 a.m.