navigate_connected_paths: Navigate Connected Paths

View source: R/navigate_connected_paths.R

navigate_connected_pathsR Documentation

Description

Given a dendritic network and set of ids, finds paths or lengths between all identified flowpath outlets. This algorithm finds paths between outlets regardless of flow direction.

Usage

navigate_connected_paths(x, outlets, status = FALSE)

Arguments

x

data.frame network compatible with hydroloom_names.

outlets

vector or list of length 2 of ids from data.frame

status

logical print status and progress bars?

Details

Required attributes: id, toid, length_km

If outlets is a vector, all combinations (combn) of the given outlets will be produced. If outlets is a list, it must be of length 2 (froms, tos). Recycling is performed via expand.grid if child vector lengths do not match. outlets may also be a 2-column dataframe.

Value

data.frame containing the distance between pairs of network outlets and a list column containing flowpath identifiers along path that connect outlets. For a network with one terminal outlet, the data.frame will have nrow(x)^2 rows.

Examples

x <- sf::read_sf(system.file("extdata", "walker.gpkg", package = "hydroloom"))

outlets <- c(5329303, 5329357, 5329317, 5329365, 5329435, 5329817)

x <- add_toids(hy(x))

navigate_connected_paths(x, outlets)


hydroloom documentation built on Aug. 4, 2026, 1:07 a.m.