Skip to contents

Calculate water quality scores

Usage

assess_wq(df, parameter_name, unit, max_criteria = NULL, min_criteria = NULL)

Arguments

df

DOEE Ambient Water Quality Data that has been processed and formatted

parameter_name

String to indicate target parameter: "Conductivity", "Dissolved oxygen (DO)", "Escherichia coli", "pH", "Temperature, water", "Turbidity"

unit

String to indicate unit for water quality parameter

max_criteria

DC water quality criteria as a maximum value

min_criteria

DC water quality criteria as a minimum value

Value

List of three dataframes: results, summary, score

Examples

assess_wq(df_wq_processed_example,
                    parameter_name = "Temperature, water",
                    unit = "deg C",
                    max_criteria = 24)
#> $results
#> # A tibble: 586 × 9
#>    sample_id   location_id date       parameter unit  result qualifier excursion
#>    <chr>       <chr>       <date>     <chr>     <chr>  <dbl> <chr>         <dbl>
#>  1 RCR01_1507… RCR01       2015-07-14 Temperat… deg C  23.2  ""               NA
#>  2 RCR01_1508… RCR01       2015-08-11 Temperat… deg C  22.8  ""               NA
#>  3 RCR01_1509… RCR01       2015-09-21 Temperat… deg C  19.4  ""               NA
#>  4 RCR01_1510… RCR01       2015-10-20 Temperat… deg C   9.10 ""               NA
#>  5 RCR01_1511… RCR01       2015-11-03 Temperat… deg C  12.5  ""               NA
#>  6 RCR01_1512… RCR01       2015-12-15 Temperat… deg C  12.4  ""               NA
#>  7 RCR01_1601… RCR01       2016-01-05 Temperat… deg C   1.85 ""               NA
#>  8 RCR01_1602… RCR01       2016-02-02 Temperat… deg C   3.21 ""               NA
#>  9 RCR01_1603… RCR01       2016-03-15 Temperat… deg C  10.8  ""               NA
#> 10 RCR01_1604… RCR01       2016-04-05 Temperat… deg C  10.3  ""               NA
#> # ℹ 576 more rows
#> # ℹ 1 more variable: outside_limit <dbl>
#> 
#> $summary
#> # A tibble: 25 × 9
#>    sci_subshed  n_tests n_tests_failed excursion     nse    f2    f3   wqi score
#>    <chr>          <int>          <dbl>     <dbl>   <dbl> <dbl> <dbl> <dbl> <dbl>
#>  1 Battery Kem…      14              0    0      0        0    0     100   10   
#>  2 Broad Branch      14              0    0      0        0    0     100   10   
#>  3 Dalecarlia …      14              1    0.0904 0.00646  7.14 0.642  94.9  9.49
#>  4 Dumbarton O…      14              0    0      0        0    0     100   10   
#>  5 Fenwick Bra…      14              1    0.0179 0.00128  7.14 0.128  94.9  9.49
#>  6 Fort Chapli…      13              0    0      0        0    0     100   10   
#>  7 Fort Davis …      14              0    0      0        0    0     100   10   
#>  8 Fort Dupont…      10              0    0      0        0    0     100   10   
#>  9 Fort Stanto…      14              1    0.0321 0.00229  7.14 0.229  94.9  9.49
#> 10 Foundry Bra…      14              0    0      0        0    0     100   10   
#> # ℹ 15 more rows
#> 
#> $score
#> # A tibble: 25 × 2
#>    sci_subshed            `Temperature, water`
#>    <chr>                                 <dbl>
#>  1 Battery Kemble Creek                  10   
#>  2 Broad Branch                          10   
#>  3 Dalecarlia Tributary                   9.49
#>  4 Dumbarton Oaks                        10   
#>  5 Fenwick Branch                         9.49
#>  6 Fort Chaplin Tributary                10   
#>  7 Fort Davis Tributary                  10   
#>  8 Fort Dupont Tributary                 10   
#>  9 Fort Stanton Tributary                 9.49
#> 10 Foundry Branch                        10   
#> # ℹ 15 more rows
#>