Detect whether a braid exists in a NHDPlus flowlines Network Check if if a NHDPlus network dataset contains any braids. If multiple discontinuous networks are within the 'network' data, a 'terminal_id' can be be provided to uniquely check each network for braids. If no terminal_id is given, the function will try to infer the distinct networks and then check for braids in each component (using find_connected_components()).
is_braided.Rd
Detect whether a braid exists in a NHDPlus flowlines Network Check if if a NHDPlus network dataset contains any braids. If multiple discontinuous networks are within the 'network' data, a 'terminal_id' can be be provided to uniquely check each network for braids. If no terminal_id is given, the function will try to infer the distinct networks and then check for braids in each component (using find_connected_components()).
Arguments
- network
data.frame with comid, tonode, fromnode, divergence and (optionally) terminalpa attributes.
- terminal_id
character, column name containing a unique identifier, delineating separate 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'
- recycle
logical, whether the return logical vector should be recycled to the length of the number of unique networks (disconnected networks/outlets/terminalpa). If FALSE (default), the function returns TRUE if ANY of the networks contain a braid. Otherwise, if TRUE, the function attempts to distinguish the different/separate network components and returns a logical vector the length of the number of connected components in the network.If a 'terminal_id' is given, the return logical vector will use the 'terminal_id' column to name the vector, if 'terminal_id' is NULL, then an arbitrary COMID is used to uniquely identify each distinct port of the network and these arbitrary COMIDs are used to name the logical vector elements.
- verbose
logical print status updates, if TRUE, messages will print. Default is FALSE.