Given a network and set of IDs, finds paths between all identified flowpath outlets. This algorithm finds members between outlets regardless of flow direction.

get_path_members(outlets, network, cores = 1, status = FALSE)

Arguments

outlets

vector of IDs from data.frame

network

data.frame with ID, toID, and lengthkm attributes.

cores

integer number of cores to use for parallel computation.

status

logical print status and progress bars?

Value

list of lists containing flowpath identifiers along path that connect outlets.

Examples

source(system.file("extdata", "walker_data.R", package = "nhdplusTools"))
fline <- walker_flowline

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

# Add toCOMID
fline <- nhdplusTools::get_tocomid(fline, add = TRUE)

fl <- dplyr::select(fline, ID = comid, toID = tocomid, lengthkm)

get_path_members(outlets, fl)
#> Warning: get_paths* is deprecated in favor of get_paths in the hydroloom package.
#>       id_1    id_2                                                      path
#> 1  5329303 5329357                                       7, 6, 5, 4, 3, 2, 1
#> 2  5329303 5329317                                                   3, 2, 1
#> 3  5329303 5329365                                    8, 7, 6, 5, 4, 3, 2, 1
#> 4  5329303 5329435 15, 14, 13, 12, 11, 60, 62, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
#> 5  5329303 5329817                                     18, 17, 5, 4, 3, 2, 1
#> 6  5329357 5329317                                                7, 6, 5, 4
#> 7  5329357 5329365                                                         8
#> 8  5329357 5329435                      15, 14, 13, 12, 11, 60, 62, 10, 9, 8
#> 9  5329357 5329817                                              7, 6, 18, 17
#> 10 5329317 5329365                                             8, 7, 6, 5, 4
#> 11 5329317 5329435          15, 14, 13, 12, 11, 60, 62, 10, 9, 8, 7, 6, 5, 4
#> 12 5329317 5329817                                              18, 17, 5, 4
#> 13 5329365 5329435                         15, 14, 13, 12, 11, 60, 62, 10, 9
#> 14 5329365 5329817                                           8, 7, 6, 18, 17
#> 15 5329435 5329817        15, 14, 13, 12, 11, 60, 62, 10, 9, 8, 7, 6, 18, 17