Calculate DPS reuse and end of pipe loads and summarize
Arguments
- fls
vector of file paths to raw entity data, one to many
- summ
chr string indicating how the returned data are summarized, see details
- summtime
chr string indicating how the returned data are summarized temporally (month or year), see details
Value
data frame with loading data for TP, TN, TSS, and BOD as tons per month/year and hydro load as million cubic meters per month/year
Details
Input data files in fls
are first processed by anlz_dps_facility
to calculate DPS reuse and end of pipe for each facility and outfall. The data are summarized differently based on the summ
and summtime
arguments. All loading data are summed based on these arguments, e.g., by bay segment (summ = 'segment'
) and year (summtime = 'year'
).
Examples
fls <- list.files(system.file('extdata/', package = 'tbeploads'),
pattern = 'ps_dom', full.names = TRUE)
anlz_dps(fls)
#> # A tibble: 108 × 10
#> Year Month source entity segment tn_load tp_load tss_load bod_load hy_load
#> <int> <int> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 2017 1 DPS - e… Hills… Hillsb… 0.0924 1.32e-2 0.0388 0.0955 0.0704
#> 2 2017 2 DPS - e… Hills… Hillsb… 0.105 1.79e-2 0.0497 0.182 0.0901
#> 3 2017 3 DPS - e… Hills… Hillsb… 0.0167 2.46e-3 0.00647 0.0127 0.0117
#> 4 2017 4 DPS - e… Hills… Hillsb… 0.00249 2.88e-4 0.000626 0.00175 0.00114
#> 5 2017 5 DPS - e… Hills… Hillsb… 0.0219 1.05e-2 0.0116 0.0396 0.0211
#> 6 2017 6 DPS - e… Hills… Hillsb… 0.329 8.41e-2 0.134 0.281 0.238
#> 7 2017 7 DPS - e… Hills… Hillsb… 0.215 5.95e-2 0.114 0.293 0.208
#> 8 2017 8 DPS - e… Hills… Hillsb… 0.369 1.05e-1 0.188 0.493 0.341
#> 9 2017 9 DPS - e… Hills… Hillsb… 0.603 1.51e-1 0.202 0.548 0.360
#> 10 2017 10 DPS - e… Hills… Hillsb… 0.286 6.08e-2 0.113 0.371 0.204
#> # ℹ 98 more rows