Skip to contents

Detect whether a braid exists in a hydrologic network Check if if a hydrologic network dataset contains any braids. If multiple discontinuous networks are within the 'network' data. The function will try to infer the distinct networks and then check for braids in each component (using find_connected_components()).

Usage

is_braided(network, crosswalk_id = NULL, recycle = FALSE, verbose = FALSE)

Arguments

network

sf data.frame of linestrings with a unique <crosswalk_id> attribute.

crosswalk_id

unique ID column name

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.

verbose

logical print status updates, if TRUE, messages will print. Default is FALSE.

Value

logical, If TRUE, at least one braid was detected in network, FALSE if no braids were found. If multiple components are found OR a terminal_id column is given, each unique network is checked for braiding (recycles to length of unique "terminal_id")