Calls subset_rpu for all raster processing units for the requested vector processing unit.

subset_vpu(fline, vpu, include_null_rpuid = TRUE, run_make_standalone = TRUE)

Arguments

fline

sf data.frame NHD Flowlines with comid, pathlength, lengthkm, hydroseq, levelpathi, rpuid, vpuid, and arbolatesu (dnhydroseq is required if tocomid is not provided).

vpu

character e.g. "01"

include_null_rpuid

logical default TRUE. Note that there are some flowlines that may have a NULL rpuid but be included in the vector processing unit.

run_make_standalone

logical default TRUE should the run_make_standalone function be run on result?

Value

data.frame containing subset network

Examples


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

sample_flines <- sf::read_sf(sample_data, "NHDFlowline_Network")

subset_vpu(sample_flines, "07")
#> Simple feature collection with 267 features and 136 fields
#> Geometry type: MULTILINESTRING
#> Dimension:     XYZM
#> Bounding box:  xmin: -89.58537 ymin: 42.95163 xmax: -89.19935 ymax: 43.30179
#> z_range:       zmin: 0 zmax: 0
#> m_range:       mmin: 0 mmax: 100
#> Geodetic CRS:  GRS 1980(IUGG, 1980)
#> # A tibble: 267 × 137
#>       COMID FDATE               RESOLUTION GNIS_ID  GNIS_NAME LENGTHKM REACHCODE
#>  *    <int> <dttm>              <chr>      <chr>    <chr>        <dbl> <chr>    
#>  1 13296606 1999-10-15 00:00:00 Medium     "157707… "Yahara …    0.091 07090002…
#>  2 13297170 2009-05-01 00:00:00 Medium     "157707… "Yahara …    2.85  07090002…
#>  3 13297160 2009-05-01 00:00:00 Medium     "157707… "Yahara …    0.041 07090002…
#>  4 13293970 1999-10-29 00:00:00 Medium     "157707… "Yahara …    0.096 07090002…
#>  5 13293750 1999-10-29 00:00:00 Medium     "157707… "Yahara …    1.72  07090002…
#>  6 13296614 1999-10-15 00:00:00 Medium     " "      " "          4.59  07090002…
#>  7 13297104 1999-10-15 00:00:00 Medium     "156066… "Murphys…    4.53  07090002…
#>  8 13297106 1999-10-15 00:00:00 Medium     "156066… "Murphys…    2.70  07090002…
#>  9 13294002 1999-10-29 00:00:00 Medium     "157516… "Swan Cr…    0.111 07090002…
#> 10 13297098 1999-10-15 00:00:00 Medium     "157516… "Swan Cr…    1.44  07090002…
#> # ℹ 257 more rows
#> # ℹ 130 more variables: FLOWDIR <chr>, WBAREACOMI <int>, FTYPE <chr>,
#> #   FCODE <int>, Shape_Length <dbl>, StreamLeve <int>, StreamOrde <int>,
#> #   StreamCalc <int>, FromNode <dbl>, ToNode <dbl>, Hydroseq <dbl>,
#> #   LevelPathI <dbl>, Pathlength <dbl>, TerminalPa <dbl>, ArbolateSu <dbl>,
#> #   Divergence <int>, StartFlag <int>, TerminalFl <dbl>, DnLevel <dbl>,
#> #   UpLevelPat <dbl>, UpHydroseq <dbl>, DnLevelPat <dbl>, DnMinorHyd <dbl>, …