allupstream: Return a vector of all subcatchments upstream of a specified...

Description Usage Arguments Value Note Examples

View source: R/allupstream.R

Description

Return a vector of all subcatchments upstream of a specified catchment

Usage

1
allupstream(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 upstream 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_upstream it is possible to get a list of catchments upstream of a vector of sites. This can then be used to support further aggregation of environmental variables for contributing catchments upstream of a list of catchments of interest (for example for aggregating rainfall).

Examples

1
2
3
4
5
6
data(mwcats)

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

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

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