
Create a summary table of AMBI category percentages by bay segment
Source:R/show_ambitab.R
show_ambitab.RdCreate a summary table of AMBI category percentages by bay segment
Arguments
- ambiscr
input data frame as returned by
anlz_ambiscr, the AMBI variant is detected automatically from the column names- bay_segment
chr string for the bay segment, one to many of "OTB", "HB", "MTB", "LTB", "TCB", "MR", "BCB"
- yrrng
numeric vector of length two indicating the year range to summarise
Value
A flextable object showing the count and percentage of sites in each AMBI category by bay segment over the requested year range. The bottom row ("All") summarises across all included bay segments.
Details
Only sampling funded by TBEP and as part of the routine EPC benthic monitoring program are included. Azoic stations are excluded from counts and percentages. The year range filter applies to all years from yrrng[1] through yrrng[2].
Column header colours match those used in show_ambimatrix: Unpolluted (dark green), Slightly Polluted (light green), Meanly Polluted (yellow), Heavily Polluted (orange), and Extremely Polluted (red).
Examples
ambiscr <- anlz_ambiscr(benthicdata)
show_ambitab(ambiscr)
Segment
n
Extremely Polluted
Heavily Polluted
Meanly Polluted
Slightly Polluted
Unpolluted
OTB
318
1.3%
0.0%
1.3%
85.2%
12.3%
HB
470
4.0%
0.2%
6.4%
88.7%
0.6%
MTB
332
0.3%
0.0%
0.0%
84.6%
15.1%
LTB
258
0.0%
0.0%
0.0%
85.3%
14.7%
TCB
129
0.0%
0.8%
1.6%
90.7%
7.0%
MR
237
0.0%
0.0%
1.3%
97.0%
1.7%
BCB
365
1.6%
0.5%
1.9%
91.5%
4.4%
All
2,109
1.4%
0.2%
2.2%
88.7%
7.5%