2.2 Cross-reference benthic codes

Last updated

July 6, 2026

2.2 Cross-reference benthic codes

On this page

TCRMP, VINPS, and CSUN each name benthic taxa with their own codes. This page joins those three code sets into one cross-reference table so a single taxon carries one shared identity across all three programs. We read the TCRMP master code list and the VINPS taxon list, match them by scientific name (falling back to a code match), and pull the CSUN column names from the two CSUN benthic data sets. We then load the reviewed cross-reference, split each coral’s Meaning into genus and species, and write the joined table to outputs/s2pt2_benthicCoverCodes.csv. The final chunk saves benthicCoverXrefBenthicCodes.RData, the workspace that sections 2.3 through 2.10 load. This is a data-preparation page: it holds no time series, and it feeds the entire downstream benthic cover section.

Data sources

This page uses three program code lists: the TCRMP benthic-code master (TCRMP_benthicCodes_data.csv), the VINPS taxon table (VINPS_coverSpecificBenthicGroups_allSites_1999_2020_data.csv), and the CSUN column headers carried in the reformatted workspace from section 2.1. The joined cross-reference is finalized from the tracked file benthicCodes_crossref.csv, which carries the UAGA correction (VINPS records Agaricia agaricites under the code UAGA). The full cross-reference table is available to download below.

Load workspace and define variables

What happens here. We reopen the reformatted-data workspace from section 2.1, locate the most recent benthicCoverReformatData_<timestamp> folder so intermediate CSVs land beside the data they describe, and set the section tag s2pt2 that names every file this page writes.

Show code
# Load the previous workspace
load("benthicCoverReformatData.RData")

# Function to find latest benthicCoverReformatData folder
get_latest_data_folder <- function() {
  # List all directories in current folder
  all_dirs <- list.dirs(path = ".", recursive = FALSE)
  
  # Filter for benthicCoverReformatData folders
  data_dirs <- grep("^\\./benthicCoverReformatData_\\d{8}_\\d{6}$", all_dirs, value = TRUE)
  
  if (length(data_dirs) == 0) {
    stop("No benthicCoverReformatData folders found!")
  }
  
  # Sort by name (which includes timestamp) and get the latest
  latest_dir <- sort(data_dirs, decreasing = TRUE)[1]
  
  # Remove "./" from the start
  sub("^\\./", "", latest_dir)
}

# Get the latest data folder name
bc_subfoldername <- get_latest_data_folder()
# message("Using data folder: ", bc_subfoldername)

section <- "s2pt2"

Load and process TCRMP benthic codes

We read the TCRMP master code list and drop the calculation rows (two spellings of the same label), keeping only the real benthic taxa and categories. A copy is written beside the reformatted data for provenance.

Show code
tcrmp_benthicCodes <- read.csv(
  "../../../RRSdata/data_TCRMP/xtra_originalExcelSheets_metadata/TCRMP_benthicCodes_data.csv"
) %>%
  filter(!Group %in% c("Caclulation", "Calculation"))

write.csv(
  tcrmp_benthicCodes,
  paste0(bc_subfoldername, "/tcrmp_benthicCodes.csv"),
  row.names = FALSE
)

Load and process VINPS benthic codes

We read the VINPS taxon table and collapse it to one row per taxon, counting how often each taxon appears as prev. This gives a clean VINPS code list to match against the TCRMP taxa.

Show code
vinps_benthicCodes <- read.csv(
  "../../../RRSdata/data_VINPS/VINPS_coverSpecificBenthicGroups_allSites_1999_2020_data.csv"
) %>%
  group_by(TaxonCode,
           TaxonScientificName,
           TaxonDescription,
           Category,
           SubCategory) %>%
  summarise(prev = n(), .groups = "drop")

write.csv(
  vinps_benthicCodes,
  paste0(bc_subfoldername, "/vinps_benthicCodes.csv"),
  row.names = FALSE
)

Cross-reference VINPS and TCRMP benthic codes

For each TCRMP taxon, we search the VINPS list first by scientific name and then, if that fails, by code, and we attach the matching VINPS row alongside the TCRMP row. The two halves keep tcrmp_ and vinps_ prefixes so their columns stay distinct in the joined table.

Show code
xref_codes <- function(tcrmp_codes, vinps_codes) {
  vc <- matrix(nrow = nrow(tcrmp_codes),
               ncol = ncol(vinps_codes)) %>%
    as.data.frame()
  colnames(vc) <- colnames(vinps_codes)
  
  for (i in 1:nrow(tcrmp_codes)) {
    indi <- tcrmp_codes[i, ]
    match_scientific <- which(vinps_codes$TaxonScientificName == indi$Meaning)
    match_code <- which(vinps_codes$TaxonCode == indi$Code)
    
    if (length(match_scientific) > 0) {
      vc[i, ] <- vinps_codes[match_scientific[1], ]
    } else if (length(match_code) > 0) {
      vc[i, ] <- vinps_codes[match_code[1], ]
    }
  }
  
  colnames(tcrmp_codes) <- paste0("tcrmp_", colnames(tcrmp_codes))
  colnames(vc) <- paste0("vinps_", colnames(vinps_codes))
  
  cbind(tcrmp_codes, vc)
}

benthicCodes <- xref_codes(tcrmp_benthicCodes, vinps_benthicCodes)

write.csv(benthicCodes,
          paste0(bc_subfoldername, "/benthiccodes_temp.csv"),
          row.names = FALSE)

Load and process CSUN benthic codes

CSUN stores its taxa as column headers rather than as a code list. We pull those headers from the two CSUN benthic data sets (the random sites, and the original Yawzi and Tektite sites) and write each set out so the CSUN taxa can be matched into the cross-reference.

Show code
csun_random_benthicCodes <- colnames(csun_random_benthicDat)[7:ncol(csun_random_benthicDat)] %>%
  data.frame(csun_random_benthicCodes = .)

csun_yztk_benthicCodes <- colnames(csun_yztk_benthicDat)[7:ncol(csun_yztk_benthicDat)] %>%
  data.frame(csun_yztk_benthicCodes = .)

write.csv(
  csun_random_benthicCodes,
  paste0(bc_subfoldername, "/csun_random_benthicCodes.csv"),
  row.names = FALSE
)
write.csv(
  csun_yztk_benthicCodes,
  paste0(bc_subfoldername, "/csun_yztk_benthicCodes.csv"),
  row.names = FALSE
)

Load fully cross-referenced benthic codes

The automatic match above resolves most taxa, but a handful of program-specific naming quirks need a hand check. We finalize the cross-reference from the tracked, reviewed file benthicCodes_crossref.csv, committed with the repository so this page reproduces from versioned inputs. It carries the UAGA correction, and this loaded table is the canonical benthicCodes object that the rest of section 2 uses.

Show code
# Canonical, tracked cross-reference (carries the UAGA hand-correction). Committed with the
# repository, so this page reproduces from versioned inputs, not a local working folder.
benthicCodes <- read.csv("benthicCodes_crossref.csv", header = TRUE)
Note

Validation note. The finalized cross-reference holds 119 code rows across 12 columns. The UAGA correction is present: VINPS code UAGA (Undaria agaricites, a synonym of Agaricia agaricites) is mapped in the vinps_TaxonCode column, so VINPS Agaricia agaricites cover carries through the downstream sections rather than being silently dropped.

Add coral genus and species for more detailed coral look

For the coral rows, we split the TCRMP Meaning into a genus and a species so the later coral pages can group at either level. A few labels need small fixes: “Branching” corals are recorded as Porites, and the “Coral” and “Juvenile” placeholders become “unknown” and “unknown juv.”.

Show code
coralind <- which(benthicCodes$tcrmp_Category == "Coral")

benthicCodes[coralind, c("genus", "species")] <-
  str_split_fixed(benthicCodes$tcrmp_Meaning[coralind], " ", 2)

# Small fixes
benthicCodes$genus[benthicCodes$genus == "Branching"] <- "Porites"
benthicCodes$genus[benthicCodes$genus %in% c("Coral", "Juvenile")] <-
  c("unknown", "unknown juv.")

The cross-reference table

Table 1 shows how all three programs’ codes line up across every benthic group, not only corals. Each row is one taxon or benthic category with its TCRMP code, group, category, and meaning, the matched VINPS code and scientific name, and the CSUN column headers. Blank cells mark taxa that one program records and another does not. The table scrolls, and the full cross-reference is available to download above. It is a read-only view of the saved benthicCodes object and writes nothing.

Show code: build the full cross-reference table
# Read-only preview built AFTER the workspace is saved, so it never enters the saved RData.
# local() keeps every helper binding out of the environment as well.
local({
  full_xref <- benthicCodes[, c("tcrmp_Code", "tcrmp_Group", "tcrmp_Category", "tcrmp_Meaning",
                                "vinps_TaxonCode", "vinps_TaxonScientificName",
                                "csun_random_code", "csun_YZTK_code")]
  colnames(full_xref) <- c("TCRMP code", "TCRMP group", "TCRMP category", "TCRMP meaning",
                           "VINPS code", "VINPS scientific name", "CSUN random", "CSUN YZ/TK")
  kableExtra::kbl(full_xref, row.names = FALSE) |>
    kableExtra::kable_paper(full_width = FALSE) |>
    kableExtra::kable_styling(fixed_thead = TRUE,
                              bootstrap_options = c("hover", "striped", "condensed"),
                              font_size = 9) |>
    kableExtra::scroll_box(width = "100%", height = "520px")
})
Sec 2.2 Table 1: Full benthic cross-reference across the three monitoring programs. Each row is one taxon or benthic category, with its TCRMP code, group, category, and meaning, the matched VINPS code and scientific name, and the CSUN column headers. Blank cells mark taxa one program records and another does not.
TCRMP code TCRMP group TCRMP category TCRMP meaning VINPS code VINPS scientific name CSUN random CSUN YZ/TK
MILA Benthic Cover Coral Millepora alcicornis MALC Millepora alcicornis Millepora percentCover_allCoral
MILC Benthic Cover Coral Millepora complanata MCOM Millepora complanata Millepora percentCover_allCoral
MILS Benthic Cover Coral Millepora squarrosa MSQU Millepora squarrosa Millepora percentCover_allCoral
DCY Benthic Cover Coral Dendrogyra cylindrus DCYL Dendrogyra cylindrus Dendrogyra percentCover_allCoral
AC Benthic Cover Coral Acropora cervicornis ACER Acropora cervicornis Acropora percentCover_allCoral
AP Benthic Cover Coral Acropora palmata APAL Acropora palmata Acropora percentCover_allCoral
APR Benthic Cover Coral Acropora prolifera NA NA Acropora percentCover_allCoral
OFAV Benthic Cover Coral Orbicella faveolata OFAV Orbicella faveolata Orbicella percentCover_allCoral
OFRA Benthic Cover Coral Orbicella franksii OFRA Orbicella franksi Orbicella percentCover_allCoral
OX Benthic Cover Coral Orbicella species complex ORBI NA Orbicella percentCover_allCoral
SL Benthic Cover Coral Scolymia lacera NA NA Scolymia percentCover_allCoral
SC Benthic Cover Coral Scolymia cubensis SCOL Scolymia sp. Scolymia percentCover_allCoral
SCSP Benthic Cover Coral Scolymia spp. SCOL Scolymia sp. Scolymia percentCover_allCoral
PB Benthic Cover Coral Porites branneri NA NA Porites percentCover_allCoral
DICT Benthic Cover Macroalgae Dictyota spp. DICT Dictyota sp. percentCover_macroalgae
HALI Benthic Cover Macroalgae Halimeda spp. HALI Halimeda sp. percentCover_macroalgae
LOBO Benthic Cover Macroalgae Lobophora spp. LVAR Lobophora variegata percentCover_macroalgae
CALG Benthic Cover Calcareous Crustose coralline algae CALG NA percentCover_CTB percentCover_CTB
EAC Benthic Cover Turf Epilithic algae community DCA NA percentCover_CTB percentCover_CTB
B Benthic Cover Non-living Boulder NA NA percentCover_CTB percentCover_CTB
RO Benthic Cover Calcareous Rhodolith CALG NA percentCover_CTB percentCover_CTB
P Benthic Cover Non-living Pavement P NA percentCover_CTB percentCover_CTB
R Benthic Cover Non-living Rubble R NA percentCover_CTB percentCover_CTB
S Benthic Cover Non-living Sand S NA percentCover_CTB percentCover_CTB
MAL Benthic Cover Coral Mycetophyllia aliciae MALI Mycetophyllia aliciae Mycetopohyllia percentCover_allCoral
MDA Benthic Cover Coral Mycetophyllia daniana MDAN Mycetophyllia danaana Mycetopohyllia percentCover_allCoral
ML Benthic Cover Coral Mycetophyllia lamarckiana MLAM Mycetophyllia lamarckiana Mycetopohyllia percentCover_allCoral
MYSP Benthic Cover Coral Mycetophyllia spp. MYCE Mycetophyllia sp. Mycetopohyllia percentCover_allCoral
MAN Benthic Cover Coral Mussa angulosa MANG Mussa angulosa Mussa percentCover_allCoral
MM Benthic Cover Coral Madracis mirabilis MAUR Madracis auretenra Madracis percentCover_allCoral
IR Benthic Cover Coral Isopyhyllastrea rigida IRIG Isophyllia rigida Isophyllia percentCover_allCoral
AMPH Benthic Cover Macroalgae Amphiroa spp. AMPH Amphiroa sp.
ANEM Benthic Cover Other, Living Anemone ANEM NA
BALL Benthic Cover Sponge Ball sponge BALL NA
BRIA Benthic Cover Gorgonian Briareum asbestinum BASB Briareum asbestinum
BASP Benthic Cover Sponge Barrel/Vase sponge BASP NA
BOSP Benthic Cover Sponge Boring sponge BOSP NA
CLSP Benthic Cover Sponge Cliona spp. CLIO Cliona sp.
CLIO Benthic Cover Sponge Clionia delitrix CLIO Cliona sp.
CMOR Benthic Cover Other, Living Corallimorpharians CMOR NA
CORAL Benthic Cover Coral Coral spp. CORALU NA
CORJU Benthic Cover Coral Juvenile coral spp. CORJU NA
FLCY Benthic Cover Cyanobacteria Filamentous cyanobacteria CYAN NA
LYNG Benthic Cover Cyanobacteria Lyngbia spp. CYAN NA
SCHIZ Benthic Cover Cyanobacteria Schizothrix spp. CYAN NA
DCOR Benthic Cover Coral Condition Diseased coral DCOR NA
ERYTH Benthic Cover Gorgonian Erythropodium caribaeorum ECAR Erythropodium caribaeorum
ENGO Benthic Cover Gorgonian Encrusting Gorgonian ENGO NA
ENSP Benthic Cover Sponge Encrusting sponge ENSP NA
TWS Benthic Cover Non-living Transect tape, weighted line, or shadow EQUIP NA
FAN Benthic Cover Gorgonian Sea fan FAN NA
GO Benthic Cover Gorgonian Gorgonian GO NA
HC Benthic Cover Coral Helioseris cucullata HCUC Helioseris cucullata Helioseris
LIAG Benthic Cover Macroalgae Liagora spp. LIAG Liagora sp.
MACA Benthic Cover Macroalgae Macroalgae MACA NA percentCover_macroalgae percentCover_macroalgae
BBD Benthic Cover Coral Condition Black band disease NA NA
BL Benthic Cover Coral Condition Bleached coral NA NA
CLAD Benthic Cover Macroalgae Cladophora spp. NA NA
DSD Benthic Cover Coral Condition Dark spot disease NA NA
MICRO Benthic Cover Macroalgae Microdictyon spp. NA NA
OD Benthic Cover Coral Oculina diffusa NA NA
SB Benthic Cover Coral Solenastrea bournoni NA NA Solenastrea
SH Benthic Cover Coral Solenastrea hyades NA NA Solenastrea
SCTLD Benthic Cover Coral Condition Stony coral tissue loss disease NA NA
TC Benthic Cover Coral Tubastraea coccinea NA NA
WBD Benthic Cover Coral Condition White band disease NA NA
PLA Benthic Cover Coral Condition White plague NA NA
YBD Benthic Cover Coral Condition Yellow band disease NA NA
O Benthic Cover Other, Living Other O NA
PALY Benthic Cover Zoanthid Palythoa caribaeorum PALY Palythoa caribaeorum
PEY Benthic Cover Macroalgae Peyssonneliaceae (includes Peyssonellia spp., Ramicrusta spp.) PEYS Peyssonnelia sp.
PLUME Benthic Cover Gorgonian Sea plume PLUME NA
RAMI Benthic Cover Macroalgae Peyssonneliaceae (includes Peyssonellia spp., Ramicrusta spp.) RAMI Ramicrusta sp.
ROD Benthic Cover Gorgonian Sea rod ROD NA
ROPE Benthic Cover Sponge Rope sponge ROPE NA
SARG Benthic Cover Macroalgae Sargassum spp. SARG Sargassum sp.
SPO Benthic Cover Sponge Sponge SPO NA
TUBE Benthic Cover Sponge Tube sponge TUBE NA
UNK Benthic Cover Non-living Unknown UNK NA
WHIP Benthic Cover Gorgonian Sea whip WHIP NA
ZO Benthic Cover Zoanthid Zoanthids ZOAN Zoanthus sp.
ZOSO Benthic Cover Zoanthid Zoanthus sociatus ZOAN Zoanthus sp.
SI Benthic Cover Coral Stephanocoenia intercepta SINT Stephanocoenia intersepta Stephanocoenia percentCover_allCoral
SSPP Benthic Cover Coral Siderastrea spp. SIDE Siderastrea sp. Siderastrea percentCover_allCoral
SS Benthic Cover Coral Siderastrea siderea SSID Siderastrea siderea Siderastrea percentCover_allCoral
OA Benthic Cover Coral Orbicella annularis OANN Orbicella annularis Orbicella percentCover_allCoral
MC Benthic Cover Coral Montastraea cavernosa MCAV Montastraea cavernosa Montastrea percentCover_allCoral
MSPP Benthic Cover Coral Montastraea spp. NA NA Montastrea percentCover_allCoral
MME Benthic Cover Coral Meandrina meandrites MMEA Meandrina meandrites Meandrina percentCover_allCoral
FF Benthic Cover Coral Favia fragum FFRA Favia fragum Favia percentCover_allCoral
EF Benthic Cover Coral Eusmilia fastigiata EFAS Eusmilia fastigiata Eusmilia percentCover_allCoral
DL Benthic Cover Coral Diploria labyrinthiformis DLAB Diploria labyrinthiformis Diploria percentCover_allCoral
DSO Benthic Cover Coral Dichocoenia stokesii DSTO Dichocoenia stokesii Dichocoenia percentCover_allCoral
CN Benthic Cover Coral Colpophyllia natans CNAT Colpophyllia natans Colpophyllia percentCover_allCoral
PCL Benthic Cover Coral Pseudodiploria clivosa PCLI Pseudodiploria clivosa
PS Benthic Cover Coral Pseudodiploria strigosa PSTR Pseudodiploria strigosa
SR Benthic Cover Coral Siderastrea radians SRAD Siderastrea radians Siderastrea percentCover_allCoral
PD Benthic Cover Coral Porites divaricata NA NA Porites percentCover_allCoral
PA Benthic Cover Coral Porites astreoides PAST Porites astreoides Porites percentCover_allCoral
PF Benthic Cover Coral Porites furcata PFUR Porites furcata Porites percentCover_allCoral
PBSP Benthic Cover Coral Branching Porites spp. PORI NA Porites percentCover_allCoral
PP Benthic Cover Coral Porites porites PPOR Porites porites Porites percentCover_allCoral
MF Benthic Cover Coral Mycetophyllia ferox MFER Mycetophyllia ferox Mycetopohyllia percentCover_allCoral
MAR Benthic Cover Coral Manicina areolata MARE Manicina areolata Manicina percentCover_allCoral
MD Benthic Cover Coral Madracis decactis MDEC Madracis decactis Madracis percentCover_allCoral
MAFO Benthic Cover Coral Madracis formosa NA NA Madracis percentCover_allCoral
AF Benthic Cover Coral Agaricia fragilis AFRA Agaricia fragilis Agaricia percentCover_allCoral
AA Benthic Cover Coral Agaricia agaricites UAGA Undaria agaricites Agaricia percentCover_allCoral
AG Benthic Cover Coral Agaricia grahamae AGAR Agaricia sp. Agaricia percentCover_allCoral
AH Benthic Cover Coral Agaricia humilis AGAR Agaricia sp. Agaricia percentCover_allCoral
AGSP Benthic Cover Coral Agaricia spp. AGAR Agaricia sp. Agaricia percentCover_allCoral
AT Benthic Cover Coral Agaricia tenuifolia AGAR Agaricia sp. Agaricia percentCover_allCoral
AU Benthic Cover Coral Agaricia undata AGAR Agaricia sp. Agaricia percentCover_allCoral
AL Benthic Cover Coral Agaricia lamarcki ALAM Agaricia lamarcki Agaricia percentCover_allCoral
IS Benthic Cover Coral Isophyllia sinuosa ISIN Isophyllia sinuosa Isophyllastrea
TWS Benthic Cover Non-living Transect tape, weighted line, or shadow SHADOW NA
TWS Benthic Cover Non-living Transect tape, weighted line, or shadow SLATE NA
TWS Benthic Cover Non-living Transect tape, weighted line, or shadow TAPE NA
TWS Benthic Cover Non-living Transect tape, weighted line, or shadow WAND NA

version 1.0.0 • in-review • data ≤ 2023-12-31