findnds: Identify the next downstream site from a set of candidates

View source: R/findnds.R

findndsR Documentation

Identify the next downstream site from a set of candidates

Description

Identify the next downstream site from a set of candidates

Usage

findnds(hierarchy, catchname, candidates)

Arguments

hierarchy

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

catchname

a catchment id for which a a list of downstream catchments ids will be returned.

candidates

a vector of candidate catchment ids. Note this need not be a complete hierarchy

Value

a list of downstream catchment ids for each catchment in catchnames. Returns -1 where there is no downstream site

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

data(mwcats)

#find site next downstream of the first site in the catchment list

findnds(hierarchy = mwcats[,c(1:2)], catchname = mwcats$site[1], candidates=mwcats$site)


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