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

Description Usage Arguments Value Note Examples

View source: R/alldownstream.R

Description

Return a vector of all subcatchments downstream of a specified catchment

Usage

1
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

1
2
3
4
#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 Nov. 22, 2019, 3:41 a.m.