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

Description Usage Arguments Note Examples

View source: R/pairReaches.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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 Nov. 22, 2019, 3:41 a.m.