pairReaches: Create a list of all reaches between two sites in a river...

View source: R/pairReaches.R

pairReachesR Documentation

Create a list of all reaches between two sites in a river network (inclusive of those sites)

Description

Create a list of all reaches between two sites in a river network (inclusive of those sites)

Usage

pairReaches(hierarchy, site1, site2)

Arguments

hierarchy

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

site1

a site in a river network

site2

a site in the same river network as site1 (can be up or downstream)

Note

Produces a vector of sites between the site pair

Examples

data(mwcats)

#create a dataframe of pair reaches
pairReaches(hierarchy=mwcats[,c(1:2)], mwcats$site[1], mwcats$site[5])

#create a dataframe with all pairs from a vector of sites
df<- all_pairs(mwcats$site[1:5])

#create a list of sites between each site pair
apply(df,1 , function(x) pairReaches(hierarchy=mwcats[,c(1:2)], x[[1]],x[[2]]))


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