Learn R Programming

hydrolinks (version 0.10.0)

traverse_flowlines: traverse_flowlines

Description

traverse hydrological network

Usage

traverse_flowlines(max_distance, start, direction = c("out", "in"),
  dataset = c("nhdh", "nhdplusv2"), max_steps = 10000, db_path = NULL,
  ...)

Arguments

max_distance

maximum distance to traverse in km. If negative, traverse until the ocean (node 0) or max_steps is reached.

start

character node to start

direction

character; either "out" or "in"

dataset

which network dataset to traverse. May be either NHD high-res or NHD Plus v2.

max_steps

maximum traversal steps before terminating

db_path

manually specify path to flowtable database. Useful for avoiding database locks when running traversals in parallel.

...

options passed on to check_dl_file

Value

dataframe of nodes traversed, distance from the start node to each node, and the children of each node.

Examples

Run this code
# NOT RUN {
traverse_flowlines(1000, "141329377", "out", "nhdh")
# this example traverses until a cycle is found and the end of the network is reached.
# }

Run the code above in your browser using DataLab