isflowconnected: Check Flow-Connectedness

Description Usage Arguments Value Note Author(s) Examples

View source: R/apps_of_direction.R

Description

Checks to see if two segments are flow-connected. Called internally within riverdirection and upstream.

Usage

1
isflowconnected(seg1, seg2, rivers, stopiferror = TRUE, algorithm = NULL)

Arguments

seg1

First input segment

seg2

Second input segment

rivers

The river network object to use

stopiferror

Whether or not to exit with an error if a route cannot be found. If this is set to FALSE and a route cannot be found, the function will return NA in the appropriate entry. Defaults to TRUE. See detectroute.

algorithm

Which route detection algorithm to use ("Dijkstra", "sequential", or "segroutes"). If left as NULL (the default), the function will automatically make a selection. See detectroute for more details.

Value

Logical TRUE if the two segments are flow-connected, FALSE if they are not

Note

The river mouth must be specified (see setmouth).

Author(s)

Matt Tyers

Examples

1
2
3
4
5
6
7
data(Gulk)
plot(Gulk)

Gulk <- setmouth(seg=1, vert=1, rivers=Gulk)

isflowconnected(seg1=13, seg2=14, rivers=Gulk)
isflowconnected(seg1=13, seg2=1, rivers=Gulk)

riverdist documentation built on Sept. 10, 2021, 9:06 a.m.