list_all_upstream: Identify all the subcatchments upstream of a list of...

Description Usage Arguments Value Note Examples

View source: R/list_all_upstream.R

Description

Identify all the subcatchments upstream of a list of specified catchments

Usage

1
list_all_upstream(hierarchy, catchnames)

Arguments

hierarchy

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

catchnames

a vector of catchment ids for which a a list of upstream catchment ids will be returned.

Value

a list of upstream catchment ids for each catchment in catchnames

Note

Function depends on the next downstream field in a stream network 'hierarchy' table (dataframe). Can 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
5
6
#'data(mwcats)

#find all sites upstream of the first five sites in the catchment list
data(mwcats)

list_all_upstream(hierarchy = mwcats, catchname = mwcats$site[1:5])

nickbond/catchstats documentation built on Nov. 22, 2019, 3:41 a.m.