Assign threshold categories to Fecal Indicator Bacteria (FIB) data
Source:R/anlz_fibmap.R
anlz_fibmap.Rd
Assign threshold categories to Fecal Indicator Bacteria (FIB) data
Arguments
- fibdata
input FIB
data.frame
as returned byread_importfib
- yrsel
optional numeric value to filter output by years in
fibdata
- mosel
optional numeric value to filter output by month in
fibdata
- areasel
optional character string to filter output by stations in the
area
column offibdata
, see details
Value
A data.frame
similar to fibdata
with additional columns describing station categories and optionally filtered by arguments passed to the function
Details
This function is used to create FIB categories for mapping using show_fibmap
. Categories based on relevant thresholds are assigned to each observation. The categories are specific to E. coli or Enterococcus and are assigned based on the station class as freshwater (class
as 1 or 3F) or marine (class
as 2 or 3M), respectively. A station is categorized into one of four ranges defined by the thresholds as noted in the cat
column of the output, with corresponding colors appropriate for each range as noted in the col
column of the output.
The areasel
argument can indicate valid entries in the area
column of fibdata
. For example, use either "Alafia River"
or "Hillsborough River"
for the corresponding river basins, where rows in fibdata
are filtered based on the the selection. All stations are returned if this argument is set as NULL
(default). The Alafia River basin includes values in the area
column of fibdata
as "Alafia River"
and "Alafia River Tributary"
. The Hillsborough River basin includes values in the area
column of fibdat
as "Hillsborough River"
, "Hillsborough River Tributary"
, "Lake Thonotosassa"
, "Lake Thonotosassa Tributary"
, and "Lake Roberta"
. Not all areas may be present based on the selection. All valid options for areasel
include "Alafia River"
, "Hillsborough River"
, "Big Bend"
, "Cockroach Bay"
, "East Lake Outfall"
, "Hillsborough Bay"
, "Little Manatee"
, "Lower Tampa Bay"
, "McKay Bay"
, "Middle Tampa Bay"
, "Old Tampa Bay"
, "Palm River"
, "Tampa Bypass Canal"
, or "Valrico Lake"
.
Examples
# assign categories to all
anlz_fibmap(fibdata)
#> # A tibble: 76,502 × 12
#> area epchc_station class yr mo Latitude Longitude ecoli ecocci ind
#> <chr> <dbl> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <chr>
#> 1 Hillsb… 2 3M 2024 1 27.9 -82.5 NA 24 Ente…
#> 2 Hillsb… 6 3M 2024 1 27.9 -82.5 NA 2 Ente…
#> 3 Hillsb… 7 3M 2024 1 27.9 -82.5 NA 2 Ente…
#> 4 Hillsb… 8 3M 2024 1 27.9 -82.4 NA 10 Ente…
#> 5 Middle… 9 2 2024 1 27.8 -82.4 NA 2 Ente…
#> 6 Middle… 11 2 2024 1 27.8 -82.5 NA 2 Ente…
#> 7 Middle… 13 2 2024 1 27.8 -82.5 NA 2 Ente…
#> 8 Middle… 14 2 2024 1 27.8 -82.5 NA 2 Ente…
#> 9 Middle… 16 2 2024 1 27.7 -82.5 NA 2 Ente…
#> 10 Middle… 19 2 2024 1 27.7 -82.6 NA 2 Ente…
#> # ℹ 76,492 more rows
#> # ℹ 2 more variables: cat <fct>, col <chr>
# filter by year, month, and area
anlz_fibmap(fibdata, yrsel = 2020, mosel = 7, areasel = 'Alafia River')
#> # A tibble: 24 × 12
#> area epchc_station class yr mo Latitude Longitude ecoli ecocci ind
#> <chr> <dbl> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <chr>
#> 1 Alafia… 74 3M 2020 7 27.9 -82.4 NA 168 Ente…
#> 2 Alafia… 111 3F 2020 7 27.9 -82.2 50 7000 E. c…
#> 3 Alafia… 114 3F 2020 7 27.9 -82.3 447 1560 E. c…
#> 4 Alafia… 115 3F 2020 7 27.9 -82.1 80 260 E. c…
#> 5 Alafia… 116 3F 2020 7 27.9 -82.1 30 367 E. c…
#> 6 Alafia… 139 3F 2020 7 27.7 -82.1 47 100 E. c…
#> 7 Alafia… 151 3F 2020 7 27.9 -82.2 90 25 E. c…
#> 8 Alafia… 153 3M 2020 7 27.9 -82.3 NA 4000 Ente…
#> 9 Alafia… 154 3F 2020 7 27.9 -82.1 433 1367 E. c…
#> 10 Alafia… 155 3F 2020 7 27.9 -82.2 170 233 E. c…
#> # ℹ 14 more rows
#> # ℹ 2 more variables: cat <fct>, col <chr>