Learn R Programming

nhdplusTools (version 0.3.16)

subset_rpu: Subset by Raster Processing Unit.

Description

Given flowlines and an rpu_code, performs a network-safe subset such that the result can be used in downstream processing. Has been tested to work against the entire NHDPlusV2 domain and satisfies a number of edge cases.

Usage

subset_rpu(fline, rpu, run_make_standalone = TRUE)

Arguments

fline

sf data.frame NHD Flowlines with COMID, Pathlength, LENGTHKM, and Hydroseq. LevelPathI, RPUID, ToNode, FromNode, and ArbolateSu.

rpu

character e.g. "01a"

run_make_standalone

boolean should the run_make_standalone function be run on result?

Examples

Run this code
# NOT RUN {
sample_data <- system.file("extdata/sample_natseamless.gpkg",
                           package = "nhdplusTools")

nhdplus_path(sample_data)

staged_nhdplus <- stage_national_data(output_path = tempdir())

sample_flines <- readRDS(staged_nhdplus$flowline)

subset_rpu(sample_flines, rpu = "07b")
# }

Run the code above in your browser using DataLab