Identifying Climate-Resilient Coral Reefs in Fiji

Authors

Janice Taga (Coral Reef Ecologist, WCS-Fiji)

Iain R. Caldwell (Lead Data Analyst, MERMAID)

Published

June 17, 2025

A data-driven approach supporting the 50 Reefs portfolio

Identifying climate-resilient reefs is crucial for the conservation and management of coral reef ecosystems in the face of climate change. The reefs have the potential to withstand and recover from environmental stressors, maintaining their ecological functions and biodiversity. Focusing on the conservation efforts on these resilient reefs would increase the overall survival of coral reef biodiversity and also support the livelihood of communities dependent on these ecosystems (McClanahan et al., 2024)

Refugia are defined as locations where biodiversity retreats to, persists in and potentially expands from once environmental conditions change. There are three categories of refugia for reefs: avoidance, resistance and recovery (ARR). These locations represent diverse responses that facilitate strategic conservation interventions. 

The 50 Reefs portfolio, a global study that was conducted by Beyer et al. (2018), identifies potential climate refugia locations anticipated to avoid future coral losses and is founded on excess heat metrics, such as degree heating waves. To extend the 50 Reefs portfolio, there is a need to evaluate and validate the predictions of climate refugia with long-term field data on coral abundance and diversity. 

Turning data into action

To expand the 50 Reefs portfolio within the limited timeframe leading up to 2030, we are undertaking a pilot analysis utilising a decade’s worth of benthic data from WCS-Fiji. This effort aims to advance innovative science by incorporating coral life history strategies—specifically avoidance, resistance, and recovery reefs—into the 50 Reefs.

Getting relevant data from MERMAID

Get Fiji data at all levels (with life history assignments) using the mermaidr package.

Show the code
rm(list = ls()) #remove past stored objects
options(scipen = 999) #turn off scientific notation

####  Load packages and libraries ####
library(plotly)
library(tidyverse)
library(mermaidr)
library(sf)
library(ggplot2)
library(leaflet) #for mapping
library(htmlwidgets)
library(htmltools)
library(leaflegend)
library(leafpop)

#### Retrieve WCS Fiji project data ####
#mermaid_auth(new_user = T, cache = T)
#Run the above uncommented if you are having trouble with authorization

fijiProjects <- mermaid_get_my_projects(include_test_projects = F) %>% 
  filter(countries == "Fiji")

wcsFijiProjects <- fijiProjects %>% 
  filter(grepl(pattern = "WCS Fiji", x = tags)) 

fijiBenthicPitObsTBL <- mermaid_get_project_data( 
  project = wcsFijiProjects,
  method = "benthicpit",
  data = "observations"
)

Filtering MERMAID data

The first step of identifying climate resilient reefs involves creating subsets from your projects to focus on benthic PIT observations only. Once you have created your subset, we identify and remove any benthic PIT transects that have >20% of the corals unassigned to a life history (i.e. weedy, stress-tolerant, competitive and generalist categories).

Show the code
fijiBenthicPitSuUnassignedTBL <- fijiBenthicPitObsTBL %>% 
  filter(benthic_category == "Hard coral") %>% 
  group_by(sample_unit_id) %>% 
  summarise(NumUnassignedHardCoral = sum(life_histories_competitive == 0 &
                                           life_histories_generalist == 0 &
                                           life_histories_stress_tolerant == 0 &
                                           life_histories_weedy == 0)) %>% 
  ungroup() %>% 
  right_join(fijiBenthicPitObsTBL %>% 
               group_by(sample_unit_id) %>% 
               summarise(NumPts = length(benthic_category)) %>% 
               ungroup,
             by = "sample_unit_id") %>% 
  mutate(NumUnassignedHardCoral = replace_na(NumUnassignedHardCoral, 0),
         PercUnassignedHardCoral = NumUnassignedHardCoral/NumPts*100) %>% 
  select(sample_unit_id, PercUnassignedHardCoral)

#Get the sample unit level data and remove >20% unassigned
fijiBenthicPitSuTBL <- mermaid_get_project_data(
    project = wcsFijiProjects,
    method = "benthicpit",
    data = "sampleunits") %>%
  left_join(fijiBenthicPitSuUnassignedTBL %>% 
              rename(sample_unit_ids = sample_unit_id),
            by = "sample_unit_ids") %>% 
  filter(PercUnassignedHardCoral <= 20) 

#Remove data from the following observers based on feedback
remObsVect <- c("Andra Whiteside",
                "Rob Howard",
                "Wayne Moey",
                "Epeli Logan",
                "Steven Lee",
                "Alex Patrick",
                "Naushad Yakub",
                "Thomas Tui",
                "Una Mara")

#Also remove "Sirilo Dulunaqio" but only for surveys before 2012
fijiBenthicPitSuTBL <- fijiBenthicPitSuTBL %>% 
  filter(!observers %in% remObsVect) %>% 
  filter(!(observers == "Sirilo Dulunaqio" & year(sample_date) < 2012))

Calculate averages for life histories and coral richness

Once you have assigned your coral genera to life history categories, we then calculate the quantitative averages for life history categories and the total unique coral richness per sample event.

Show the code
fijiBenthicPitSeTBL <- fijiBenthicPitSuTBL %>% 
  group_by(project, tags, country, site, latitude, longitude,
           management, management_rules, sample_date, sample_event_id) %>% 
  summarise(mean_percent_cover_life_histories_weedy = mean(percent_cover_life_histories_weedy),
            mean_percent_cover_life_histories_generalist = mean(percent_cover_life_histories_generalist),
            mean_percent_cover_life_histories_competitive = mean(percent_cover_life_histories_competitive),
            mean_percent_cover_life_histories_stress_tolerant = mean(percent_cover_life_histories_stress_tolerant),
            mean_percent_hard_coral = mean(percent_cover_benthic_category_hard_coral),
            .groups = "keep")

fijiBenthicPitSeTotalCoralRichTBL <- fijiBenthicPitObsTBL %>% 
  filter(sample_unit_id %in% fijiBenthicPitSuTBL$sample_unit_ids &
           benthic_category == "Hard coral") %>% 
  group_by(sample_event_id) %>% 
  summarise(NumUniqueHardCoralBAs = length(unique(benthic_attribute)))

fijiBenthicPitSeTBL <- fijiBenthicPitSeTBL %>% 
  left_join(fijiBenthicPitSeTotalCoralRichTBL,
            by = "sample_event_id")

Assign dominant life histories for most recent sample events

Assign sample events to the dominant life history –> avoidance, resistance, or recovery. Also filter to only use the most recent sample event

Show the code
#### Assign sample events to the dominant life histories ####
fijiBenthicPitSeTBL <- fijiBenthicPitSeTBL %>% 
  mutate(ClimateStrategy =
           case_when(mean_percent_cover_life_histories_competitive > 
                       mean_percent_cover_life_histories_weedy &
                       mean_percent_cover_life_histories_competitive > 
                       mean_percent_cover_life_histories_generalist &
                       mean_percent_cover_life_histories_competitive > 
                       mean_percent_cover_life_histories_stress_tolerant ~
                       "avoidance",
                     mean_percent_cover_life_histories_stress_tolerant > 
                       mean_percent_cover_life_histories_weedy &
                       mean_percent_cover_life_histories_stress_tolerant > 
                       mean_percent_cover_life_histories_generalist &
                       mean_percent_cover_life_histories_stress_tolerant > 
                       mean_percent_cover_life_histories_competitive ~
                       "resistance",
                     mean_percent_cover_life_histories_weedy > 
                       mean_percent_cover_life_histories_generalist &
                       mean_percent_cover_life_histories_weedy >
                       mean_percent_cover_life_histories_competitive &
                       mean_percent_cover_life_histories_weedy > 
                       mean_percent_cover_life_histories_stress_tolerant ~
                       "recovery",
                     .default = "none")) %>% 
  mutate(ClimateStrategy = 
           case_when(mean_percent_hard_coral < 30 | 
                       NumUniqueHardCoralBAs < 10 ~
                       "none",
                     .default = ClimateStrategy))

fijiClimateResTBL <- fijiBenthicPitSeTBL %>% 
  group_by(site) %>%
  slice_max(sample_date, n = 1) %>%
  ungroup()

Map the locations based on climate resilience strategies

The next step is to assign dominant life history categories to one of three climate strategies (i.e., Avoidance, Resistance and Recovery reefs). We then use existing shapefiles and the 50 Reefs geojson file to map locations of dominant climate-resilient reefs in Fiji. The following code creates a leaflet map with the 50 reefs polygons and circles that are colored by climate resilience category and sized by hard coral cover (%).

Show the code
fijiClimateResTBL <- fijiClimateResTBL %>% 
  mutate(ClimateStrategy = factor(ClimateStrategy,
                                  levels = c("avoidance", "resistance",
                                             "recovery", "none")))

#Open the 50 reefs fiji Geojson file
fiftyReefsGeojson <- read_sf("FiftyReefsFiji (1).geojson")

#Colors for 50 reefs
fiftyReefsPal <- colorFactor("Dark2", domain = levels(fiftyReefsGeojson$BCU_nam))

#Function to add size legend
addLegendSize <- function(map, position, size_values, size_labels, title, colors, fillOpacity = 0.5, borderColor = "black") {
  legend_html <- paste0(
    '<div style="background-color: white; padding: 10px; border-radius: 5px;">',
    '<strong>', title, '</strong><br>'
  )
  
  for (i in seq_along(size_values)) {
    size = size_values[i]
    label = size_labels[i]
    legend_html <- paste0(
      legend_html,
      '<div style="display: flex; align-items: center;">',
      '<svg height="', size * 2, '" width="', size * 2, '">',
      '<circle cx="', size, '" cy="', size, '" r="', size, 
      '" fill="', colors, '" fill-opacity="', fillOpacity, 
      '" stroke="', borderColor, '" stroke-width="1" />',
      '</svg>',
      '<span style="margin-left: 10px;">', label, '</span>',
      '</div>'
    )
  }
  
  legend_html <- paste0(legend_html, '</div>')
  addControl(map, html = HTML(legend_html), position = position)
}

# Define scaling function
scale_size <- function(hard_coral_percentage, scale_factor = 3) {
  hard_coral_percentage / scale_factor
}

# Legend size values and labels
size_values <- scale_size(c(10, 20, 30, 40))  # Ensure alignment with scaling logic
size_labels <- c("10%", "20%", "30%", "40%")

# Define color legend
color_pal <- colorFactor(
  palette = c("#FF9999", "lightyellow", "#6699FF",  "#66CC66"),
  domain = levels(fijiClimateResTBL$ClimateStrategy)
)

# Define a function to add circle markers
addClimateStrategyMarkers <- function(map, data) {
  map %>%
    addCircleMarkers(
      data = data,
      radius = ~scale_size(mean_percent_hard_coral),
      fillColor = ~color_pal(ClimateStrategy),  # Use color palette
      color = "black",
      weight = 1,
      stroke = TRUE,
      group = ~ClimateStrategy,  # Assign group dynamically
      fillOpacity = 0.5,
      popup = ~paste0("Category: ",
                     ClimateStrategy, 
                     "<br>Weedy: ",
                     round(mean_percent_cover_life_histories_weedy, 2),
                     "%",
                     "<br>Generalist: ",
                     round(mean_percent_cover_life_histories_generalist, 2),
                     "%",
                     "<br>Competitive: ",
                     round(mean_percent_cover_life_histories_competitive, 2),
                     "%",
                     "<br>Stress tolerant: ",
                     round(mean_percent_cover_life_histories_stress_tolerant, 2),
                     "%",
                     "<br># unique coral types: ",
                     NumUniqueHardCoralBAs))}

# Create a leaflet map with circle markers
coralResilience50reefsMap <- leaflet() %>%
  addTiles(group = "StreetMap") %>%
  addProviderTiles(providers$Esri.WorldImagery, group = "ESRI World Imagery") %>%
  setView(lng = 179, lat = -17.5, zoom = 8) %>%
  addPolygons(data = fiftyReefsGeojson,
              color = fiftyReefsPal(fiftyReefsGeojson$BCU_nam),
              stroke = 1,
              opacity = 0.8,
              group = "50 Reefs") %>%
  addClimateStrategyMarkers(fijiClimateResTBL) %>%  # Use the function
  addLegendSize(
    position = "bottomright",
    size_values = size_values,
    size_labels = size_labels,
    title = "Circle Size: Hard Coral %",
    colors = "black"
  ) %>%
  addLegend(
    position = "bottomright",
    pal = color_pal,
    values = levels(fijiClimateResTBL$ClimateStrategy),  # Use factor levels
    title = "Climate Strategy",
    opacity = 1
  ) %>%
  addLegend(data = fiftyReefsGeojson,
          position = "bottomright",
          pal = fiftyReefsPal,
          values = ~BCU_nam,
          title = "50 Reefs Name",
          opacity = 1) %>% 
  addLayersControl(baseGroups = c("StreetMap", "ESRI World Imagery"),
                   overlayGroups = c("avoidance", "resistance",
                                     "recovery", "none", "50 Reefs"),
                   position = "topright")

# Save the map as an HTML file
saveWidget(coralResilience50reefsMap, "../FijiClimateResilient50reefsMap.html",
           selfcontained = TRUE)

coralResilience50reefsMap

References

Beyer, H. L., Kennedy, E. V., Beger, M., Chen, C. A., Cinner, J. E., Darling, E. S., Eakin, C. M., Gates, R. D., Heron, S. F., & Knowlton, N. (2018). Risk‐sensitive planning for conserving coral reefs under rapid climate change. Conservation Letters, 11(6), e12587. https://doi.org/10.1111/conl.12587

Darling, E. S., Alvarez‐Filip, L., Oliver, T. A., McClanahan, T. R., & Côté, I. M. (2012). Evaluating life‐history strategies of reef corals from species traits. Ecology Letters, 15(12), 1378–1386. https://doi.org/10.1111/j.1461-0248.2012.01861.x

McClanahan, T. R., Darling, E. S., Beger, M., Fox, H. E., Grantham, H. S., Jupiter, S. D., Logan, C. A., Mcleod, E., McManus, L. C., & Oddenyo, R. M. (2024). Diversification of refugia types needed to secure the future of coral reefs subject to climate change. Conservation Biology, 38(1), e14108. https://doi.org/10.1111/cobi.14108