Skip to contents

Analyze Fecal Indicator Bacteria categories over time by station

Usage

anlz_fibmatrix(fibdata, yrrng = NULL, stas = NULL, lagyr = 3)

Arguments

fibdata

input data frame as returned by read_importfib

yrrng

numeric vector indicating min, max years to include, defaults to range of years in epcdata

stas

optional numeric vector of stations to include, see details

lagyr

numeric for year lag to calculate categories, see details

Value

A tibble object with FIB summaries by year and station, including columns for the estimated geometric mean of fecal coliform concentrations (gmean), the proportions of samples exceeding 400 CFU / 100 mL (exced), the count of samples (cnt), and a category indicating a letter outcome based on the proportion of exceedences (cat).

Details

This function is used to create output for plotting a matrix stoplight graphic for FIB categories by station and year. Each station and year combination is categorized based on the likelihood of fecal indicator bacteria concentrations exceeding 400 CFU / 100 mL in a given year (using Fecal Coliform, fcolif in fibdata). 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%, 10-30%, 30-50%, 50-75%, and >75% (right-closed). By default, the results for each year are based on a right-centered window that uses the previous two years and the current year to calculate probabilities using the monthly samples (lagyr = 3). See show_fibmatrix for additional details.

See also

Examples

anlz_fibmatrix(fibdata)
#> # A tibble: 8,800 × 4
#>       yr epchc_station gmean cat  
#>    <dbl> <fct>         <dbl> <chr>
#>  1  1985 2             52.4  B    
#>  2  1985 6              7.21 A    
#>  3  1985 7              4.64 A    
#>  4  1985 8              9.49 A    
#>  5  1985 9              6.32 A    
#>  6  1985 11             5.18 A    
#>  7  1985 13             4    A    
#>  8  1985 14             6.35 A    
#>  9  1985 16             4    A    
#> 10  1985 19             4    A    
#> # ℹ 8,790 more rows