AMBI Validation: TBEP vs EPCHC

Published

May 29, 2026

Setup

Load the package, run scores, and read the EPCHC reference outputs. TBEP Biotic Coefficients are rounded to one decimal place after scoring to match the EPCHC Access intermediate rounding step, ensuring that only true biological differences appear in the comparisons rather than platform arithmetic differences.

Code
devtools::load_all('C:/proj/tbeptools', quiet = TRUE)
library(readxl)
library(dplyr)
library(tidyr)
library(ggplot2)
library(flextable)
library(htmltools)

ambi_dev <- '../data-raw/EPCHC'

# Round BC to 1 decimal and reapply BC-based classifications to match EPCHC rounding
round_ambi_bc <- function(scr) {
  scr |>
    mutate(
      BC = round(BC, 1),
      SitePollutionClassification = case_when(
        BC == 7     ~ 'Azoic',
        BC <= 1.2   ~ 'Unpolluted',
        BC <= 3.301 ~ 'Slightly Polluted',
        BC <= 5.01  ~ 'Meanly Polluted',
        BC <= 6.01  ~ 'Heavily Polluted',
        TRUE        ~ NA_character_
      ),
      BioticIndex = case_when(
        BC == 7     ~ 'Azoic',
        BC <= 0.2   ~ '0',
        BC <= 1.201 ~ '1',
        BC <= 3.301 ~ '2',
        BC <= 4.301 ~ '3',
        BC <= 5.01  ~ '4',
        BC <= 5.501 ~ '5',
        BC <= 6.01  ~ '6',
        TRUE        ~ NA_character_
      ),
      DominatingEcologicalGroup = case_when(
        BC == 7     ~ 'Azoic',
        BC <= 1.2   ~ 'Group I',
        BC <= 3.301 ~ 'Group III',
        BC <= 5.01  ~ 'Group IV-V',
        BC <= 6.01  ~ 'Group V',
        TRUE        ~ NA_character_
      ),
      BenthicCommunityHealth = case_when(
        BC == 7     ~ 'Azoic',
        BC <= 0.2   ~ 'Normal',
        BC <= 1.201 ~ 'Impoverished',
        BC <= 3.301 ~ 'Unbalanced',
        BC <= 4.301 ~ 'Transitional to Pollution',
        BC <= 5.01  ~ 'Polluted',
        BC <= 5.501 ~ 'Transition to Heavy Pollution',
        BC <= 6.01  ~ 'Heavily Polluted',
        TRUE        ~ NA_character_
      )
    )
}

# TBEP scores
ambiscr    <- anlz_ambiscr(benthicdata) |> round_ambi_bc()
ambiscr_tb <- anlz_ambiscr(benthicdata, type = 'AMBI-TB') |> round_ambi_bc()

# EPCHC reference outputs
xl_ambi3 <- read_excel(file.path(ambi_dev, 'AMBI3-BioticCoefficient.xlsx'))
xl_ambi4 <- read_excel(file.path(ambi_dev, 'AMBI4-ReportableStats.xlsx'))
xl_tb3   <- read_excel(file.path(ambi_dev, 'AMBI-TB3BioticCoefficient.xlsx'))
xl_tb4   <- read_excel(file.path(ambi_dev, 'AMBI-TB4ReportableStats.xlsx'))

# Bay segments to include (display order)
segs <- c('OTB', 'HB', 'MTB', 'LTB', 'BCB', 'TCB', 'MR')
Code
# Prepare joined dataset for continuous variable comparison.
# tbep_dat: output of anlz_ambiscr (has PercentG1-G5, BC, AreaAbbr)
# epchc_dat: AMBI3 or AMBI-TB3 Excel file (has PercentG1-G5, BioticCoefficient)
prep_continuous <- function(tbep_dat, epchc_dat) {
  tbep_side <- tbep_dat |>
    filter(!is.na(BC), BC != 7, AreaAbbr %in% segs) |>
    mutate(AreaAbbr = factor(AreaAbbr, levels = segs)) |>
    select(yr, StationNumber, AreaAbbr,
           PercentG1_tbep = PercentG1, PercentG2_tbep = PercentG2,
           PercentG3_tbep = PercentG3, PercentG4_tbep = PercentG4,
           PercentG5_tbep = PercentG5, BC_tbep = BC)

  epchc_side <- epchc_dat |>
    mutate(yr = as.integer(Year)) |>
    select(yr, StationNumber,
           PercentG1_epchc = PercentG1, PercentG2_epchc = PercentG2,
           PercentG3_epchc = PercentG3, PercentG4_epchc = PercentG4,
           PercentG5_epchc = PercentG5,
           BC_epchc = BioticCoefficient) |>
    mutate(across(starts_with('Percent'), \(x) coalesce(x, 0)))

  inner_join(tbep_side, epchc_side, by = c('yr', 'StationNumber')) |>
    filter(!is.na(BC_epchc)) |>
    pivot_longer(
      cols = -c(yr, StationNumber, AreaAbbr),
      names_to  = c('variable', '.value'),
      names_pattern = '(.+)_(tbep|epchc)'
    ) |>
    mutate(
      variable = factor(variable,
        levels = c('PercentG1', 'PercentG2', 'PercentG3',
                   'PercentG4', 'PercentG5', 'BC'))
    )
}

# Prepare joined dataset for categorical variable comparison.
# tbep_dat: output of anlz_ambiscr
# epchc_dat: AMBI4 or AMBI-TB4 Excel file
prep_categorical <- function(tbep_dat, epchc_dat) {
  tbep_side <- tbep_dat |>
    filter(AreaAbbr %in% segs) |>
    mutate(AreaAbbr = factor(AreaAbbr, levels = segs)) |>
    select(yr, StationNumber, AreaAbbr,
           SitePollutionClassification, BioticIndex,
           DominatingEcologicalGroup, BenthicCommunityHealth)

  epchc_side <- epchc_dat |>
    mutate(
      yr = as.integer(Year),
      BioticIndex = as.character(BioticIndex)
    ) |>
    select(yr, StationNumber,
           SPC_epchc = SitePollutionClassification,
           BI_epchc  = BioticIndex,
           DEG_epchc = DominatingEcologicalGroup,
           BCH_epchc = BenthicCommunityHealth)

  inner_join(tbep_side, epchc_side, by = c('yr', 'StationNumber'))
}

# Confusion matrix as a list of flextables, one per bay segment.
# Diagonal cells (TBEP == EPCHC) are highlighted in blue.
table_confusion <- function(dat, tbep_col, epchc_col) {
  dat_filt <- dat |>
    filter(
      !is.na(.data[[tbep_col]]),  .data[[tbep_col]]  != 'Azoic',
      !is.na(.data[[epchc_col]]), .data[[epchc_col]] != 'Azoic'
    )

  all_cats     <- sort(unique(c(dat_filt[[tbep_col]], dat_filt[[epchc_col]])))
  segs_present <- intersect(segs, as.character(unique(dat_filt$AreaAbbr)))

  lapply(segs_present, function(seg) {
    ct <- dat_filt |>
      filter(AreaAbbr == seg) |>
      count(TBEP = .data[[tbep_col]], EPCHC = .data[[epchc_col]]) |>
      complete(TBEP = all_cats, EPCHC = all_cats, fill = list(n = 0L)) |>
      pivot_wider(names_from = EPCHC, values_from = n, values_fill = 0L)

    epchc_cols <- setdiff(names(ct), 'TBEP')

    ft <- flextable(ct) |>
      set_header_labels(TBEP = '') |>
      add_header_row(
        values    = c('TBEP', 'EPCHC'),
        colwidths = c(1L, length(epchc_cols))
      ) |>
      add_header_lines(values = paste('Bay Segment:', seg)) |>
      align(align = 'center', part = 'all') |>
      align(j = 1L, align = 'left', part = 'body') |>
      bold(bold = FALSE, part = 'header') |>
      autofit()

    for (cat in all_cats) {
      ri <- which(ct$TBEP == cat)
      ci <- which(names(ct) == cat)
      if (length(ri) > 0L && length(ci) > 0L)
        ft <- bg(ft, i = ri, j = ci, bg = '#BDD7EE')
    }

    ft
  })
}

Standard AMBI

Continuous variables

1:1 comparison of group percentages (PercentG1–G5) and Biotic Coefficient (BC) between TBEP and EPCHC for matched stations. The red line is the 1:1 reference. EPCHC PercentG1G5 are NA when no taxa belong to a group; these are treated as 0 to match TBEP behaviour. Stations with NA Biotic Coefficient in the EPCHC output are excluded.

Code
cmp_ambi_cont <- prep_continuous(ambiscr, xl_ambi3)
cat('Matched station-years (continuous):', nrow(cmp_ambi_cont) / 6, '\n')
Matched station-years (continuous): 2986 
Code
ggplot(cmp_ambi_cont, aes(x = epchc, y = tbep)) +
  geom_point(alpha = 0.3, size = 0.5, colour = 'grey30') +
  geom_abline(slope = 1, intercept = 0, colour = 'red', linewidth = 0.5) +
  facet_grid(variable ~ AreaAbbr, scales = 'free') +
  labs(x = 'EPCHC', y = 'TBEP') +
  theme_bw(base_size = 8) +
  theme(strip.text = element_text(size = 7))

Standard AMBI: 1:1 comparison of continuous variables by bay segment. Red line = 1:1 reference.

Standard AMBI: 1:1 comparison of continuous variables by bay segment. Red line = 1:1 reference.

Categorical variables

Confusion matrices comparing TBEP and EPCHC classifications for matched, non-azoic stations. Rows = TBEP category, columns = EPCHC category. Diagonal cells (highlighted) = agreement.

Code
cmp_ambi_cat <- prep_categorical(ambiscr, xl_ambi4)
cat('Matched station-years (categorical):', nrow(cmp_ambi_cat), '\n')
Matched station-years (categorical): 3071 

Site Pollution Classification

Code
tagList(lapply(table_confusion(cmp_ambi_cat, 'SitePollutionClassification', 'SPC_epchc'), htmltools_value))

Bay Segment: OTB

TBEP

EPCHC

Heavily Polluted

Meanly Polluted

Slightly Polluted

Unpolluted

Heavily Polluted

1

0

0

0

Meanly Polluted

0

51

0

0

Slightly Polluted

0

0

465

0

Unpolluted

0

0

1

59

Bay Segment: HB

TBEP

EPCHC

Heavily Polluted

Meanly Polluted

Slightly Polluted

Unpolluted

Heavily Polluted

1

0

0

0

Meanly Polluted

0

40

0

0

Slightly Polluted

0

0

519

0

Unpolluted

0

0

0

4

Bay Segment: MTB

TBEP

EPCHC

Heavily Polluted

Meanly Polluted

Slightly Polluted

Unpolluted

Heavily Polluted

0

0

0

0

Meanly Polluted

0

8

0

0

Slightly Polluted

0

0

528

0

Unpolluted

0

0

2

84

Bay Segment: LTB

TBEP

EPCHC

Heavily Polluted

Meanly Polluted

Slightly Polluted

Unpolluted

Heavily Polluted

0

0

0

0

Meanly Polluted

0

0

0

0

Slightly Polluted

0

0

317

0

Unpolluted

0

0

1

59

Bay Segment: BCB

TBEP

EPCHC

Heavily Polluted

Meanly Polluted

Slightly Polluted

Unpolluted

Heavily Polluted

2

0

0

0

Meanly Polluted

0

14

0

0

Slightly Polluted

0

0

398

0

Unpolluted

0

0

1

20

Bay Segment: TCB

TBEP

EPCHC

Heavily Polluted

Meanly Polluted

Slightly Polluted

Unpolluted

Heavily Polluted

1

0

0

0

Meanly Polluted

0

5

0

0

Slightly Polluted

0

0

146

0

Unpolluted

0

0

0

16

Bay Segment: MR

TBEP

EPCHC

Heavily Polluted

Meanly Polluted

Slightly Polluted

Unpolluted

Heavily Polluted

0

0

0

0

Meanly Polluted

0

3

0

0

Slightly Polluted

0

0

234

0

Unpolluted

0

0

0

6

Biotic Index

Code
tagList(lapply(table_confusion(cmp_ambi_cat, 'BioticIndex', 'BI_epchc'), htmltools_value))

Bay Segment: OTB

TBEP

EPCHC

0

1

2

3

4

6

0

1

0

0

0

0

0

1

0

58

1

0

0

0

2

0

0

465

0

0

0

3

0

0

0

35

0

0

4

0

0

0

0

16

0

6

0

0

0

0

0

1

Bay Segment: HB

TBEP

EPCHC

0

1

2

3

4

6

0

1

0

0

0

0

0

1

0

3

0

0

0

0

2

0

0

519

0

0

0

3

0

0

0

24

0

0

4

0

0

0

0

16

0

6

0

0

0

0

0

1

Bay Segment: MTB

TBEP

EPCHC

0

1

2

3

4

6

0

0

1

0

0

0

0

1

0

83

2

0

0

0

2

0

0

528

0

0

0

3

0

0

0

4

0

0

4

0

0

0

0

4

0

6

0

0

0

0

0

0

Bay Segment: LTB

TBEP

EPCHC

0

1

2

3

4

6

0

0

0

0

0

0

0

1

0

59

1

0

0

0

2

0

0

317

0

0

0

3

0

0

0

0

0

0

4

0

0

0

0

0

0

6

0

0

0

0

0

0

Bay Segment: BCB

TBEP

EPCHC

0

1

2

3

4

6

0

1

0

0

0

0

0

1

0

19

1

0

0

0

2

0

0

398

0

0

0

3

0

0

0

10

0

0

4

0

0

0

0

4

0

6

0

0

0

0

0

2

Bay Segment: TCB

TBEP

EPCHC

0

1

2

3

4

6

0

0

0

0

0

0

0

1

0

16

0

0

0

0

2

0

0

146

0

0

0

3

0

0

0

3

0

0

4

0

0

0

0

2

0

6

0

0

0

0

0

1

Bay Segment: MR

TBEP

EPCHC

0

1

2

3

4

6

0

0

0

0

0

0

0

1

0

6

0

0

0

0

2

0

0

234

0

0

0

3

0

0

0

2

0

0

4

0

0

0

0

1

0

6

0

0

0

0

0

0

Dominating Ecological Group

Code
tagList(lapply(table_confusion(cmp_ambi_cat, 'DominatingEcologicalGroup', 'DEG_epchc'), htmltools_value))

Bay Segment: OTB

TBEP

EPCHC

Group I

Group III

Group IV-V

Group V

Group I

59

1

0

0

Group III

0

465

0

0

Group IV-V

0

0

51

0

Group V

0

0

0

1

Bay Segment: HB

TBEP

EPCHC

Group I

Group III

Group IV-V

Group V

Group I

4

0

0

0

Group III

0

519

0

0

Group IV-V

0

0

40

0

Group V

0

0

0

1

Bay Segment: MTB

TBEP

EPCHC

Group I

Group III

Group IV-V

Group V

Group I

84

2

0

0

Group III

0

528

0

0

Group IV-V

0

0

8

0

Group V

0

0

0

0

Bay Segment: LTB

TBEP

EPCHC

Group I

Group III

Group IV-V

Group V

Group I

59

1

0

0

Group III

0

317

0

0

Group IV-V

0

0

0

0

Group V

0

0

0

0

Bay Segment: BCB

TBEP

EPCHC

Group I

Group III

Group IV-V

Group V

Group I

20

1

0

0

Group III

0

398

0

0

Group IV-V

0

0

14

0

Group V

0

0

0

2

Bay Segment: TCB

TBEP

EPCHC

Group I

Group III

Group IV-V

Group V

Group I

16

0

0

0

Group III

0

146

0

0

Group IV-V

0

0

5

0

Group V

0

0

0

1

Bay Segment: MR

TBEP

EPCHC

Group I

Group III

Group IV-V

Group V

Group I

6

0

0

0

Group III

0

234

0

0

Group IV-V

0

0

3

0

Group V

0

0

0

0

Benthic Community Health

Code
tagList(lapply(table_confusion(cmp_ambi_cat, 'BenthicCommunityHealth', 'BCH_epchc'), htmltools_value))

Bay Segment: OTB

TBEP

EPCHC

Heavily Polluted

Impoverished

Normal

Polluted

Transitional to Pollution

Unbalanced

Heavily Polluted

1

0

0

0

0

0

Impoverished

0

58

0

0

0

1

Normal

0

0

1

0

0

0

Polluted

0

0

0

16

0

0

Transitional to Pollution

0

0

0

0

35

0

Unbalanced

0

0

0

0

0

465

Bay Segment: HB

TBEP

EPCHC

Heavily Polluted

Impoverished

Normal

Polluted

Transitional to Pollution

Unbalanced

Heavily Polluted

1

0

0

0

0

0

Impoverished

0

3

0

0

0

0

Normal

0

0

1

0

0

0

Polluted

0

0

0

16

0

0

Transitional to Pollution

0

0

0

0

24

0

Unbalanced

0

0

0

0

0

519

Bay Segment: MTB

TBEP

EPCHC

Heavily Polluted

Impoverished

Normal

Polluted

Transitional to Pollution

Unbalanced

Heavily Polluted

0

0

0

0

0

0

Impoverished

0

83

0

0

0

2

Normal

0

1

0

0

0

0

Polluted

0

0

0

4

0

0

Transitional to Pollution

0

0

0

0

4

0

Unbalanced

0

0

0

0

0

528

Bay Segment: LTB

TBEP

EPCHC

Heavily Polluted

Impoverished

Normal

Polluted

Transitional to Pollution

Unbalanced

Heavily Polluted

0

0

0

0

0

0

Impoverished

0

59

0

0

0

1

Normal

0

0

0

0

0

0

Polluted

0

0

0

0

0

0

Transitional to Pollution

0

0

0

0

0

0

Unbalanced

0

0

0

0

0

317

Bay Segment: BCB

TBEP

EPCHC

Heavily Polluted

Impoverished

Normal

Polluted

Transitional to Pollution

Unbalanced

Heavily Polluted

2

0

0

0

0

0

Impoverished

0

19

0

0

0

1

Normal

0

0

1

0

0

0

Polluted

0

0

0

4

0

0

Transitional to Pollution

0

0

0

0

10

0

Unbalanced

0

0

0

0

0

398

Bay Segment: TCB

TBEP

EPCHC

Heavily Polluted

Impoverished

Normal

Polluted

Transitional to Pollution

Unbalanced

Heavily Polluted

1

0

0

0

0

0

Impoverished

0

16

0

0

0

0

Normal

0

0

0

0

0

0

Polluted

0

0

0

2

0

0

Transitional to Pollution

0

0

0

0

3

0

Unbalanced

0

0

0

0

0

146

Bay Segment: MR

TBEP

EPCHC

Heavily Polluted

Impoverished

Normal

Polluted

Transitional to Pollution

Unbalanced

Heavily Polluted

0

0

0

0

0

0

Impoverished

0

6

0

0

0

0

Normal

0

0

0

0

0

0

Polluted

0

0

0

1

0

0

Transitional to Pollution

0

0

0

0

2

0

Unbalanced

0

0

0

0

0

234


Tampa Bay AMBI

Continuous variables

Code
cmp_tb_cont <- prep_continuous(ambiscr_tb, xl_tb3)
cat('Matched station-years (continuous):', nrow(cmp_tb_cont) / 6, '\n')
Matched station-years (continuous): 2991 
Code
ggplot(cmp_tb_cont, aes(x = epchc, y = tbep)) +
  geom_point(alpha = 0.3, size = 0.5, colour = 'grey30') +
  geom_abline(slope = 1, intercept = 0, colour = 'red', linewidth = 0.5) +
  facet_grid(variable ~ AreaAbbr, scales = 'free') +
  labs(x = 'EPCHC', y = 'TBEP') +
  theme_bw(base_size = 8) +
  theme(strip.text = element_text(size = 7))

AMBI-TB: 1:1 comparison of continuous variables by bay segment. Red line = 1:1 reference.

AMBI-TB: 1:1 comparison of continuous variables by bay segment. Red line = 1:1 reference.

Categorical variables

Code
cmp_tb_cat <- prep_categorical(ambiscr_tb, xl_tb4)
cat('Matched station-years (categorical):', nrow(cmp_tb_cat), '\n')
Matched station-years (categorical): 3076 

Site Pollution Classification

Code
tagList(lapply(table_confusion(cmp_tb_cat, 'SitePollutionClassification', 'SPC_epchc'), htmltools_value))

Bay Segment: OTB

TBEP

EPCHC

Heavily Polluted

Meanly Polluted

Slightly Polluted

Unpolluted

Heavily Polluted

28

0

0

0

Meanly Polluted

0

51

0

0

Slightly Polluted

0

0

294

0

Unpolluted

0

0

0

204

Bay Segment: HB

TBEP

EPCHC

Heavily Polluted

Meanly Polluted

Slightly Polluted

Unpolluted

Heavily Polluted

10

0

0

0

Meanly Polluted

0

98

0

0

Slightly Polluted

0

0

377

0

Unpolluted

0

0

0

84

Bay Segment: MTB

TBEP

EPCHC

Heavily Polluted

Meanly Polluted

Slightly Polluted

Unpolluted

Heavily Polluted

4

0

0

0

Meanly Polluted

0

9

0

0

Slightly Polluted

0

0

247

0

Unpolluted

0

0

0

362

Bay Segment: LTB

TBEP

EPCHC

Heavily Polluted

Meanly Polluted

Slightly Polluted

Unpolluted

Heavily Polluted

0

0

0

0

Meanly Polluted

0

0

0

0

Slightly Polluted

0

0

19

0

Unpolluted

0

0

0

358

Bay Segment: BCB

TBEP

EPCHC

Heavily Polluted

Meanly Polluted

Slightly Polluted

Unpolluted

Heavily Polluted

4

0

0

0

Meanly Polluted

0

22

0

0

Slightly Polluted

0

0

158

0

Unpolluted

0

0

0

251

Bay Segment: TCB

TBEP

EPCHC

Heavily Polluted

Meanly Polluted

Slightly Polluted

Unpolluted

Heavily Polluted

1

0

0

0

Meanly Polluted

0

8

0

0

Slightly Polluted

0

0

86

0

Unpolluted

0

0

1

72

Bay Segment: MR

TBEP

EPCHC

Heavily Polluted

Meanly Polluted

Slightly Polluted

Unpolluted

Heavily Polluted

2

0

0

0

Meanly Polluted

0

4

0

0

Slightly Polluted

0

0

163

0

Unpolluted

0

0

0

74

Biotic Index

Code
tagList(lapply(table_confusion(cmp_tb_cat, 'BioticIndex', 'BI_epchc'), htmltools_value))

Bay Segment: OTB

TBEP

EPCHC

0

1

2

3

4

5

6

0

15

0

0

0

0

0

0

1

0

189

0

0

0

0

0

2

0

0

294

0

0

0

0

3

0

0

0

25

0

0

0

4

0

0

0

0

26

0

0

5

0

0

0

0

0

7

0

6

0

0

0

0

0

0

21

Bay Segment: HB

TBEP

EPCHC

0

1

2

3

4

5

6

0

5

0

0

0

0

0

0

1

0

79

0

0

0

0

0

2

0

0

377

0

0

0

0

3

0

0

0

82

0

0

0

4

0

0

0

0

16

0

0

5

0

0

0

0

0

5

0

6

0

0

0

0

0

0

5

Bay Segment: MTB

TBEP

EPCHC

0

1

2

3

4

5

6

0

16

0

0

0

0

0

0

1

0

346

0

0

0

0

0

2

0

0

247

0

0

0

0

3

0

0

0

6

0

0

0

4

0

0

0

0

3

0

0

5

0

0

0

0

0

0

0

6

0

0

0

0

0

0

4

Bay Segment: LTB

TBEP

EPCHC

0

1

2

3

4

5

6

0

23

0

0

0

0

0

0

1

0

335

0

0

0

0

0

2

0

0

19

0

0

0

0

3

0

0

0

0

0

0

0

4

0

0

0

0

0

0

0

5

0

0

0

0

0

0

0

6

0

0

0

0

0

0

0

Bay Segment: BCB

TBEP

EPCHC

0

1

2

3

4

5

6

0

8

0

0

0

0

0

0

1

0

243

0

0

0

0

0

2

0

0

158

0

0

0

0

3

0

0

0

16

0

0

0

4

0

0

0

0

6

0

0

5

0

0

0

0

0

1

0

6

0

0

0

0

0

0

3

Bay Segment: TCB

TBEP

EPCHC

0

1

2

3

4

5

6

0

3

0

0

0

0

0

0

1

0

69

1

0

0

0

0

2

0

0

86

0

0

0

0

3

0

0

0

6

0

0

0

4

0

0

0

0

2

0

0

5

0

0

0

0

0

1

0

6

0

0

0

0

0

0

0

Bay Segment: MR

TBEP

EPCHC

0

1

2

3

4

5

6

0

2

0

0

0

0

0

0

1

0

72

0

0

0

0

0

2

0

0

163

0

0

0

0

3

0

0

0

4

0

0

0

4

0

0

0

0

0

0

0

5

0

0

0

0

0

1

0

6

0

0

0

0

0

0

1

Dominating Ecological Group

Code
tagList(lapply(table_confusion(cmp_tb_cat, 'DominatingEcologicalGroup', 'DEG_epchc'), htmltools_value))

Bay Segment: OTB

TBEP

EPCHC

Group I

Group III

Group IV-V

Group V

Group I

204

0

0

0

Group III

0

294

0

0

Group IV-V

0

0

51

0

Group V

0

0

0

28

Bay Segment: HB

TBEP

EPCHC

Group I

Group III

Group IV-V

Group V

Group I

84

0

0

0

Group III

0

377

0

0

Group IV-V

0

0

98

0

Group V

0

0

0

10

Bay Segment: MTB

TBEP

EPCHC

Group I

Group III

Group IV-V

Group V

Group I

362

0

0

0

Group III

0

247

0

0

Group IV-V

0

0

9

0

Group V

0

0

0

4

Bay Segment: LTB

TBEP

EPCHC

Group I

Group III

Group IV-V

Group V

Group I

358

0

0

0

Group III

0

19

0

0

Group IV-V

0

0

0

0

Group V

0

0

0

0

Bay Segment: BCB

TBEP

EPCHC

Group I

Group III

Group IV-V

Group V

Group I

251

0

0

0

Group III

0

158

0

0

Group IV-V

0

0

22

0

Group V

0

0

0

4

Bay Segment: TCB

TBEP

EPCHC

Group I

Group III

Group IV-V

Group V

Group I

72

1

0

0

Group III

0

86

0

0

Group IV-V

0

0

8

0

Group V

0

0

0

1

Bay Segment: MR

TBEP

EPCHC

Group I

Group III

Group IV-V

Group V

Group I

74

0

0

0

Group III

0

163

0

0

Group IV-V

0

0

4

0

Group V

0

0

0

2

Benthic Community Health

Code
tagList(lapply(table_confusion(cmp_tb_cat, 'BenthicCommunityHealth', 'BCH_epchc'), htmltools_value))

Bay Segment: OTB

TBEP

EPCHC

Heavily Polluted

Impoverished

Normal

Polluted

Transition to Heavy Pollution

Transitional to Pollution

Unbalanced

Heavily Polluted

21

0

0

0

0

0

0

Impoverished

0

189

0

0

0

0

0

Normal

0

0

15

0

0

0

0

Polluted

0

0

0

26

0

0

0

Transition to Heavy Pollution

0

0

0

0

7

0

0

Transitional to Pollution

0

0

0

0

0

25

0

Unbalanced

0

0

0

0

0

0

294

Bay Segment: HB

TBEP

EPCHC

Heavily Polluted

Impoverished

Normal

Polluted

Transition to Heavy Pollution

Transitional to Pollution

Unbalanced

Heavily Polluted

5

0

0

0

0

0

0

Impoverished

0

79

0

0

0

0

0

Normal

0

0

5

0

0

0

0

Polluted

0

0

0

16

0

0

0

Transition to Heavy Pollution

0

0

0

0

5

0

0

Transitional to Pollution

0

0

0

0

0

82

0

Unbalanced

0

0

0

0

0

0

377

Bay Segment: MTB

TBEP

EPCHC

Heavily Polluted

Impoverished

Normal

Polluted

Transition to Heavy Pollution

Transitional to Pollution

Unbalanced

Heavily Polluted

4

0

0

0

0

0

0

Impoverished

0

346

0

0

0

0

0

Normal

0

0

16

0

0

0

0

Polluted

0

0

0

3

0

0

0

Transition to Heavy Pollution

0

0

0

0

0

0

0

Transitional to Pollution

0

0

0

0

0

6

0

Unbalanced

0

0

0

0

0

0

247

Bay Segment: LTB

TBEP

EPCHC

Heavily Polluted

Impoverished

Normal

Polluted

Transition to Heavy Pollution

Transitional to Pollution

Unbalanced

Heavily Polluted

0

0

0

0

0

0

0

Impoverished

0

335

0

0

0

0

0

Normal

0

0

23

0

0

0

0

Polluted

0

0

0

0

0

0

0

Transition to Heavy Pollution

0

0

0

0

0

0

0

Transitional to Pollution

0

0

0

0

0

0

0

Unbalanced

0

0

0

0

0

0

19

Bay Segment: BCB

TBEP

EPCHC

Heavily Polluted

Impoverished

Normal

Polluted

Transition to Heavy Pollution

Transitional to Pollution

Unbalanced

Heavily Polluted

3

0

0

0

0

0

0

Impoverished

0

243

0

0

0

0

0

Normal

0

0

8

0

0

0

0

Polluted

0

0

0

6

0

0

0

Transition to Heavy Pollution

0

0

0

0

1

0

0

Transitional to Pollution

0

0

0

0

0

16

0

Unbalanced

0

0

0

0

0

0

158

Bay Segment: TCB

TBEP

EPCHC

Heavily Polluted

Impoverished

Normal

Polluted

Transition to Heavy Pollution

Transitional to Pollution

Unbalanced

Heavily Polluted

0

0

0

0

0

0

0

Impoverished

0

69

0

0

0

0

1

Normal

0

0

3

0

0

0

0

Polluted

0

0

0

2

0

0

0

Transition to Heavy Pollution

0

0

0

0

1

0

0

Transitional to Pollution

0

0

0

0

0

6

0

Unbalanced

0

0

0

0

0

0

86

Bay Segment: MR

TBEP

EPCHC

Heavily Polluted

Impoverished

Normal

Polluted

Transition to Heavy Pollution

Transitional to Pollution

Unbalanced

Heavily Polluted

1

0

0

0

0

0

0

Impoverished

0

72

0

0

0

0

0

Normal

0

0

2

0

0

0

0

Polluted

0

0

0

0

0

0

0

Transition to Heavy Pollution

0

0

0

0

1

0

0

Transitional to Pollution

0

0

0

0

0

4

0

Unbalanced

0

0

0

0

0

0

163