View source: R/show_fibmatrix.R
show_fibmatrix | R Documentation |
Plot a matrix of Fecal Indicator Bacteria categories over time by station or bay segment
show_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,
txtsz = 3,
asreact = FALSE,
nrows = 10,
family = NA,
angle = 90,
size = 10,
hjust = 0,
plotly = FALSE,
width = NULL,
height = NULL,
warn = TRUE
)
fibdata |
input data frame as returned by |
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 |
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 |
precipdata |
input data frame as returned by |
temporal_window |
numeric; required if |
wet_threshold |
numeric; required if |
txtsz |
numeric for size of text in the plot, applies only if |
asreact |
logical indicating if a |
nrows |
if |
family |
optional chr string indicating font family for text labels |
angle |
numeric for angle of x-axis text labels |
size |
numeric for size of the x-axis text labels |
hjust |
numeric for horizontal justification of x-axis text labels |
plotly |
logical if matrix is created using plotly |
width |
numeric for width of the plot in pixels, only applies of |
height |
numeric for height of the plot in pixels, only applies of |
warn |
logical to print warnings about stations with insufficient data, default |
The matrix color codes years and stations based on the likelihood of fecal indicator bacteria concentrations exceeding 410 CFU / 100 mL for E. coli (fresh) or 130 CFU / 100 mL for Enterococcus (marine). Bay segments are used instead of stations if bay_segment
is not NULL
and the input data are from read_importentero
. The likelihoods 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 from the monthly samples (lagyr = 3
). Methods and rationale for this categorization scheme are provided by the Florida Department of Environmental Protection, Figure 8 in the document at http://publicfiles.dep.state.fl.us/DEAR/BMAP/Tampa/MST%20Report/Fecal%20BMAP%20DST%20Final%20Report%20–%20June%202008.pdf and Morrison et al. 2009 in the BASIS 5 proceedings.
See anlz_fibmatrix
for additional details on the arguments.
A static ggplot
object is returned by default. A reactable
table is returned if asreact = TRUE
. An interactive plotly
object is returned if plotly = TRUE
.
anlz_fibmatrix
show_fibmatrix(fibdata)
# show matrix for only dry samples
show_fibmatrix(enterodata, lagyr = 1, subset_wetdry = "dry",
temporal_window = 2, wet_threshold = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.