checkbraidedTF: Check for Braiding in a River Network

View source: R/detectbraiding.R

checkbraidedTFR Documentation

Check for Braiding in a River Network

Description

Detects braiding (multiple flow channels between two locations) within a river network object, and returns a logical value for specifying braiding within a river network object.

Usage

checkbraidedTF(rivers, toreturn = "rivers", progress = TRUE)

Arguments

rivers

The river network object to check.

toreturn

Specifying toreturn="rivers" (the default) will return a river network object with a value of TRUE or FALSE assigned to the $braided element of the river network object. Specifying toreturn="logical" will just return TRUE if braiding is detected or FALSE if no braiding is detected. Specifying toreturn="routes" will return the first two differing routes detected, which may be useful in identifying where the problem lies.

progress

Whether to show the progress bar. Defaults to TRUE.

Note

This function is called within cleanup, which is recommended in most cases.

Author(s)

Matt Tyers

Examples

data(Gulk,KilleyW)
Gulk <- setmouth(seg=1, vert=1, rivers=Gulk)
plot(x=Gulk)
checkbraidedTF(rivers=Gulk, toreturn="logical")

KilleyW <- setmouth(seg=1, vert=288, rivers=KilleyW)
plot(x=KilleyW)
checkbraidedTF(rivers=KilleyW, toreturn="logical")
checkbraidedTF(rivers=KilleyW, toreturn="routes")

KilleyW.1 <- checkbraidedTF(rivers=KilleyW, toreturn="rivers")
str(KilleyW.1)

riverdist documentation built on Aug. 22, 2023, 5:06 p.m.