get_terminal: Get Terminal ID

Description Usage Arguments Value Examples

View source: R/get_paths.R

Description

Get the ID of the basin outlet for each flowline.

Usage

1
get_terminal(x, outlets)

Arguments

x

two column data.frame with IDs and toIDs. Names are ignored.

outlets

IDs of outlet flowlines

Value

data.frame containing the terminal ID for each outlet

Examples

1
2
3
4
5
6
7
8
source(system.file("extdata", "walker_data.R", package = "nhdplusTools"))

fl <- dplyr::select(prepare_nhdplus(walker_flowline, 0, 0),
                    ID = COMID, toID = toCOMID)

outlet <- fl$ID[which(!fl$toID %in% fl$ID)]

get_terminal(fl, outlet)

nhdplusTools documentation built on Aug. 18, 2021, 5:07 p.m.