Skip to contents

Find and uniquely identify braids in a network of flowlines, given a dataframe containing comid, fromnode, tonode and divergence as columns. 'find_braids()" identifies braids as cycles in the graph representation of the river network.

Usage

get_braid_list(network, terminal_id = NULL, verbose = FALSE)

Arguments

network

The network object representing the river network.

terminal_id

character, column name containing a unique identifier, delineating seperate networks in the 'network' dataset. Default is NULL which will use 'find_connected_components()' and determine the connected components in the graph to try and create a 'component_id' column in 'network'

verbose

Logical indicating whether to display verbose messages during the braid detection process.

Value

list of braid IDs and COMIDs within each braid

Examples

 if (FALSE) {
net <- nhdplusTools::navigate_network(
 start       = 101,
 mode        = "UT",
 distance_km = 100
 ) 

net <- dplyr::select(net, comid, divergence, totdasqkm, fromnode, tonode, terminalpa)

# get a dataframe of COMIDs and braid IDs
braids <- get_braid_list(network = net)
}