Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

prepare_nhdplus

Prep NHDPlus Data


Description

Function to prep NHDPlus data for use by nhdplusTools functions

Usage

prepare_nhdplus(
  flines,
  min_network_size,
  min_path_length,
  min_path_size = 0,
  purge_non_dendritic = TRUE,
  warn = TRUE,
  error = TRUE,
  skip_toCOMID = FALSE
)

Arguments

flines

data.frame NHDPlus flowlines including: COMID, LENGTHKM, FTYPE (or FCODE), TerminalFl, FromNode, ToNode, TotDASqKM, StartFlag, StreamOrde, StreamCalc, TerminalPa, Pathlength, and Divergence variables.

min_network_size

numeric Minimum size (sqkm) of drainage network to include in output.

min_path_length

numeric Minimum length (km) of terminal level path of a network.

min_path_size

numeric Minimum size (sqkm) of outlet level path of a drainage basin. Drainage basins with an outlet drainage area smaller than this will be removed.

purge_non_dendritic

boolean Should non dendritic paths be removed or not.

warn

boolean controls whether warning an status messages are printed

error

boolean controls whether to return potentially invalid data with a warning rather than an error

skip_toCOMID

boolean if TRUE, toCOMID will not be added to output.

Value

data.frame ready to be used with the refactor_flowlines function.

Examples

source(system.file("extdata", "sample_flines.R", package = "nhdplusTools"))

prepare_nhdplus(sample_flines,
                min_network_size = 10,
                min_path_length = 1,
                warn = FALSE)

nhdplusTools

NHDPlus Tools

v0.4.0
CC0
Authors
David Blodgett [aut, cre], Mike Johnson [ctb] (<https://orcid.org/0000-0002-5288-8350>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.