riverreach: returns list of subcatchments between 2 subcatchments on the...

View source: R/riverreach.R

riverreachR Documentation

returns list of subcatchments between 2 subcatchments on the same river ordered upstream to downstream

Description

returns list of subcatchments between 2 subcatchments on the same river ordered upstream to downstream

Usage

riverreach(hierarchy, upstream, downstream, riverdist = NULL)

Arguments

hierarchy

a dataframe containing catchment id and next downstream (nextds) id fields. Hierarchy must have fields 'site' and 'nextds'

upstream

the upstream subcatchment id

downstream

the downstream subcatchment id

riverdist

?

Value

Returns list of subcatchments between 2 subcatchments on the same river.

Note

riverdist, if used, should be the column number of the riverdistance measure in hierarchy. Returns the following error if downstream is not downstream of upstream: Error in while (y != downstream) : argument is of length zero' Note that unlike pairReaches riverreach preserves ordering but cannot trace down and then up tributaries.

Examples

data(mwcats)
#function needs checking.
#riverreach(hierarchy = mwcats[,c(1:2)], upstream='YARR2415', downstream='YARR001')


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