11 Biodiversity: Richness, Diversity, & Evenness

Data Type: Tabular Data (within eco_indicators)

Spatial Scope: Maritimes

Duration 1970-2022

Source: Bundy et al. 2017

11.1 Introduction to Indicator

The eco_indicators dataset provides several metrics of biodiversity from trawl surveys in the Canadian Atlantic, representing three subattributes of biodiversity (Bundy, Gomez, and Cook 2017).

  • Species Richness
    • Species Richness: Number of species recorded in a given year and sampling area.
    • Margalef’s Species Richness: A richness index that standardizes species count by sample size.
  • Species Diversity
    • Shannon Diversity: Entropy-based measure of diversity that accounts for both species richness and the relative abundances of species in a given year and sampling area.
    • Hill Diversity (N1): Exponential of the Shannon index; effective number of species in a sample, accounting for both species richness and evenness.
  • Species Evenness
    • Pielou Evenness: Measure of how evenly individuals are distributed among species.
    • Hill Dominance (N2): Reciprocal of Simpson’s index; effective indication of the number of common species in a sample.
    • Heips Evenness Index: Evenness metric derived from Shannon diversity that scales between 0 and 1 and expresses how close a community is to having equal abundances across species.

11.2 View Data


library(tidyr)
library(plotly)
library(stringr)

plotly_df <- data@data %>% inner_join(global_cols3)

# function to create plot with dropdown menu ------------------------------
make_biomass_dropdown_plot <- function(df,
                                      year_col   = "year",
                                      region_col = "region",
                                      value_suffix = "_value") {

  # convert to long format
  long <- df %>%
    janitor::clean_names() %>%
    pivot_longer(
      cols = ends_with(value_suffix),
      names_to = "metric",
      values_to = "value"
    ) %>%
    # remove suffix
    mutate(
      metric = str_remove(metric, "_value")
    ) %>%
    # drop NAs (some regions don't have data for some variables or years)
    tidyr::drop_na(value)

  # find all metrics and regions
  metrics <- unique(long$metric)
  regions <- unique(long[[region_col]])

  # clean names for dropdown panels, helper
  pretty_label <- function(x) str_to_title(gsub("_", " ", x)) %>% gsub("Lb","L B",.) %>% gsub("Mb","M B",.)

  # build plot -----------------
  p <- plot_ly()

  # add line traces
  for (metric_i in seq_along(metrics)) {
    m <- metrics[metric_i]
    
    for (region_i in regions) {
      dat <- long %>%
        filter(metric == m, .data[[region_col]] == region_i) 
      
      group_name <- unique(dat$region_group)
      color <- unique(dat$color)
      linetype <- unique(dat$linetype)
      width <- unique(dat$linewidth)
      
      # If a region truly has no data for that metric, add an empty trace
      # (keeps trace indexing stable)
      if (nrow(dat) == 0) {
        dat <- tibble::tibble(!!year_col := integer(0), value = numeric(0))
      }
      
      p <- p %>% add_lines(
        data = dat,
        x = ~.data[[year_col]],
        y = ~value,
        name = as.character(region_i),
        legendgroup = group_name,
        legendgrouptitle = list(
          text = ifelse(group_name == "ESS",
                        "Eastern Scotian Shelf Zones",
                        "Western Scotian Shelf Zones"
          )),
        showlegend = (metric_i == 1),
        visible = (metric_i == 1),
        line = list(color = color, dash = linetype),
        hovertemplate = paste0("<b>", region_i,":</b> ","%{y:.3f}<extra></extra>")      )
      
    }
  }

  n_regions <- length(regions)
  n_traces  <- length(metrics) * n_regions

  buttons <- lapply(seq_along(metrics), function(metric_i) {
    vis <- rep(FALSE, n_traces)
    shl <- rep(FALSE, n_traces)

    idx_start <- (metric_i - 1) * n_regions + 1
    idx_end   <- metric_i * n_regions
    vis[idx_start:idx_end] <- TRUE
    shl[idx_start:idx_end] <- TRUE

    list(
      method = "update",
      args = list(
        list(visible = vis, showlegend = shl),
        list(
          title = pretty_label(metrics[metric_i]),
          yaxis = list(title =  pretty_label(metrics[metric_i]))
        )
      ),
      label = pretty_label(metrics[metric_i])
    )
  })

  p %>%
    layout(
      barmode = "stack",
      hovermode = "x unified",
      title = pretty_label(metrics[1]),
      xaxis = list(title = str_to_title(year_col)),  # keep one bar per year
      yaxis = list(title = metrics[1], fixedrange = TRUE),
      legend = list(
        x = 1.02, xanchor = "left",
        y = 1,    yanchor = "top",
        groupclick = "toggleitem",
        itemdoubleclick = FALSE
      ),
      updatemenus = list(list(
        type = "dropdown",
        x = -.1, xanchor = "left",
        y = 1.15, yanchor = "top",
        buttons = buttons
      )),
      margin = list(r = 180, t = 80)
    )
}

# usage:
p <- make_biomass_dropdown_plot(plotly_df)
p <- p %>% config(displayModeBar= F)

p 

Figure 11.1: Biodiversity Indicators in all NAFO regions and Scotian Shelf regions overall. Use dropdown menu to select indicator, and click legend to toggle regions.

11.4 Relevance to Research and Stock Assessments

Biodiversity metrics such as species richness, diversity, and evenness capture complementary aspects of community structure; namely, the number of species present and how evenly biomass or abundance is distributed among them. In Atlantic Canada, these indices are used to track community-level changes alongside species-level trends, and integrated into marine spatial planning (Ward-Paige and Bundy 2016).

Biodiversity metrics can be strongly influenced by Anthropogenic effects to ecosystems. For example, the cod collapse in Atlantic Canada in the 1980s led to restructuring of marine fish communities which was detectable by changes in biodiversity indicators (McCain et al. 2016). Spatial patterns in these indicators can also be used in conservation management, for example, by targeting areas of high biodiversity for the implementation of protected or conserved areas (Shackell and Frank 2003).

Because each of these biodiversity metrics are calculated by species identification in surveys, trends can also be driven by changes in data collection method or improved species identification.

11.5 Variable Definitions

variable description unit
year Year of data collection
region Region over which observations are summarized
SpeciesRichness_ALL_value Species richness in samples Number of species
ShannonDiversity_ALL_value Shannon Diversity Dimensionless
MargalefRichness_ALL_value Margalef Richness Index Dimensionless
PielouEvenness_ALL_value Pielou Evenness Index Dimensionless
HillDiversity_ALL_value Hill Diversity (N1) Effective number of species
HillDominance_ALL_value Hill Dominance (N2) Effective number of dominant/very abundant species
Heips_ALL_value Heips evenness index Dimensionless

11.6 Additional Data

Biodiversity Variables (within eco_indicators) contains data for 4VN, 4VS, 4W, 4X, ESS, and WSS. All are shown on this page, but note that NAFO divisions are nested within Scotian Shelf regions.

11.7 Get the Data

library(marea)
data('eco_indicators')
plot(eco_indicators)

References

Bundy, Alida, Catalina Gomez, and Adam M. Cook. 2017. “Guidance Framework for the Selection and Evaluation of Ecological Indicators.” Canadian Technical Report of Fisheries and Aquatic Sciences 3232. Dartmouth, Nova Scotia, Canada: Fisheries; Oceans Canada, Bedford Institute of Oceanography. https://waves-vagues.dfo-mpo.gc.ca/Library/40648886.pdf.
McCain, J Scott P, Deneen J Cull, David C Schneider, and Heike K Lotze. 2016. “Long-Term Shift in Coastal Fish Communities Before and After the Collapse of Atlantic Cod (Gadus Morhua).” ICES Journal of Marine Science 73 (5): 1415–26.
Shackell, Nancy L, and Kenneth T Frank. 2003. “Marine Fish Diversity on the Scotian Shelf, Canada.” Aquatic Conservation: Marine and Freshwater Ecosystems 13 (4): 305–21.
Ward-Paige, Christine A, and A Bundy. 2016. Mapping Biodiversity on the Scotian Shelf and in the Bay of Fundy. Fisheries; Oceans Canada, Ecosystems; Oceans Science.