anlz_fibmatrix: Analyze Fecal Indicator Bacteria categories over time by...

View source: R/anlz_fibmatrix.R

anlz_fibmatrixR Documentation

Analyze Fecal Indicator Bacteria categories over time by station or bay segment

Description

Analyze Fecal Indicator Bacteria categories over time by station or bay segment

Usage

anlz_fibmatrix(
  fibdata,
  yrrng = NULL,
  stas = NULL,
  bay_segment = NULL,
  lagyr = 3,
  subset_wetdry = c("all", "wet", "dry"),
  precipdata = NULL,
  temporal_window = NULL,
  wet_threshold = NULL,
  warn = TRUE
)

Arguments

fibdata

input data frame as returned by read_importfib, read_importentero, or read_importwqp, see details

yrrng

numeric vector indicating min, max years to include, defaults to range of years in data, see details

stas

optional vector of stations to include, see details

bay_segment

optional vector of bay segment names to include, supercedes stas if provided, see details

lagyr

numeric for year lag to calculate categories, see details

subset_wetdry

character, subset data frame to only wet or dry samples as defined by wet_threshold and temporal_window? Defaults to "all", which will not subset. If "wet" or "dry" is specified, anlz_fibwetdry is called using the further specified parameters, and the data frame is subsetted accordingly.

precipdata

input data frame as returned by read_importrain. columns should be: station, date (yyyy-mm-dd), rain (in inches). The object catchprecip has this data from 1995-2023 for select Enterococcus stations. If NULL, defaults to catchprecip.

temporal_window

numeric; required if subset_wetdry is not "all". number of days precipitation should be summed over (1 = day of sample only; 2 = day of sample + day before; etc.)

wet_threshold

numeric; required if subset_wetdry is not "all". inches accumulated through the defined temporal window, above which a sample should be defined as being from a 'wet' time period

warn

logical to print warnings about stations with insufficient data, default TRUE

Details

This function is used to create output for plotting a matrix stoplight graphic for FIB categories by station. Each station (or bay segment) and year combination is categorized based on the likelihood of fecal indicator bacteria concentrations exceeding some threshold in a given year. For Enterococcus (marine), the default threshold is 130 CFU / 100 mL in a given year. For E. coli (fresh), the default threshold is 410 CFU / 100 mL. The proportions are categorized as A, B, C, D, or E (Microbial Water Quality Assessment or MWQA categories) with corresponding colors, where the breakpoints for each category are <10\

If the input data are from read_importentero (baywide assessment), the results can be summarized by bay segment if bay_segment is not NULL. The stas argument is ignored and all stations within each bay segment watershed are used to evaluate the FIB categories.

yrrng can be specified several ways. If yrrng = NULL, the year range of the data for the selected changes is chosen. User-defined values for the minimum and maximum years can also be used, or only a minimum or maximum can be specified, e.g., yrrng = c(2000, 2010) or yrrng = c(2000, NA). In the latter case, the maximum year will be defined by the data.

The default stations if the input is from read_importfib (EPC data) and if bay_segment is NULL are those used in TBEP report #05-13 (https://drive.google.com/file/d/1MZnK3cMzV7LRg6dTbCKX8AOZU0GNurJJ/view) for the Hillsborough River Basin Management Action Plan (BMAP) subbasins. These include Blackwater Creek (WBID 1482, EPC stations 143, 108), Baker Creek (WBID 1522C, EPC station 107), Lake Thonotosassa (WBID 1522B, EPC stations 135, 118), Flint Creek (WBID 1522A, EPC station 148), and the Lower Hillsborough River (WBID 1443E, EPC stations 105, 152, 137). Other stations can be plotted using the stas argument.

Input from read_importwqp for Manatee County (21FLMANA_WQX), Pasco County (21FLPASC_WQX), or Polk County (21FLPOLK_WQX) FIB data can also be used. The function has not been tested for other organizations.

Value

A tibble object with FIB summaries by year and station including columns for the estimated geometric mean of Enterococcus (marine) or E. coli (fresh) concentrations (gmean), the proportion of samples exceeding 130 CFU / 100 mL (Enterococcus) or 410 CFU / 100 mL (exced), the count of samples (cnt), and a category indicating a letter outcome based on the proportion of exceedences (cat). Results can be summarized by bay segment if bay_segment is not NULL and the input data is from read_importentero.

See Also

show_fibmatrix

Examples

anlz_fibmatrix(fibdata)

# use different dataset
anlz_fibmatrix(enterodata, lagyr = 1)

# subset to only wet samples
anlz_fibmatrix(enterodata, lagyr = 1, subset_wetdry = "wet",
               temporal_window = 2, wet_threshold = 0.5)

# Manatee County data
anlz_fibmatrix(mancofibdata, lagyr = 1)

tbep-tech/tbeptools documentation built on April 13, 2025, 4:50 p.m.