allupstream | R Documentation |
Return a vector of all subcatchments upstream of a specified catchment
allupstream(hierarchy, catchname)
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. |
a vector of downstream catchment ids
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).
data(mwcats)
#find all sites upstream of the first site in the catchment list
data(mwcats)
allupstream(hierarchy = mwcats, catchname = mwcats$site[1])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.