-Rounak Choudhary-
Beta diversity describes the variation in community composition among sites and is a fundamental concept for understanding spatial patterns of biodiversity. While traditional measures of beta diversity quantify the overall dissimilarity between communities, they do not distinguish the ecological processes responsible for these differences. Abundance-based beta diversity partitioning provides a more informative framework by separating total Bray–Curtis dissimilarity into two additive components: balanced variation in abundance and abundance gradients. Balanced variation reflects changes arising from the replacement or redistribution of individuals among species between communities, whereas abundance gradients represent differences resulting from the gain or loss of individuals without substantial replacement. This approach allows researchers to determine whether spatial variation in biological assemblages is driven primarily by community reorganization or by differences in overall abundance. In ecological studies, particularly within heterogeneous landscapes, abundance-based partitioning offers valuable insights into the mechanisms shaping community structure and helps identify the relative importance of environmental filtering, habitat heterogeneity, and species turnover in maintaining biodiversity.
# ============================================================
# Abundance-based Beta Diversity Partitioning
# Using betapart package
# ============================================================
# Install package if needed
if (!require(betapart)) install.packages("betapart")
library(betapart)
# ------------------------------------------------------------
# 1. Read abundance data from CSV
# ------------------------------------------------------------
# Format of data in CSV:
# Site,Sp1,Sp2,Sp3,...
# Site1,5,3,0,1,...
# Site2,2,0,4,1,...
# Site3,0,1,2,8,...
abundance_data <- read.csv(
"C:/......./Overall.csv",
row.names = 1,
check.names = FALSE
)
# Check data
head(abundance_data)
dim(abundance_data)
# ------------------------------------------------------------
# 2. Calculate abundance-based beta diversity
# ------------------------------------------------------------
beta_abund <- beta.pair.abund(abundance_data)
# ------------------------------------------------------------
# 3. Extract components
# ------------------------------------------------------------
# Balanced variation in abundance
turnover_matrix <- as.matrix(beta_abund$beta.bray.bal)
# Abundance gradients (nestedness-like component)
nestedness_matrix <- as.matrix(beta_abund$beta.bray.gra)
# Total Bray-Curtis dissimilarity
total_beta_matrix <- as.matrix(beta_abund$beta.bray)
# ------------------------------------------------------------
# 4. Save outputs
# ------------------------------------------------------------
write.csv(
turnover_matrix,
"C:/......./OverallTurnover.csv",
row.names = TRUE
)
write.csv(
nestedness_matrix,
"C:/......./OverallNestedness.csv",
row.names = TRUE
)
write.csv(
total_beta_matrix,
"C:/......./Overalleta_Bray_Total.csv",
row.names = TRUE
)
# ------------------------------------------------------------
# 5. Summary
# ------------------------------------------------------------
cat("\nFiles saved successfully:\n")
cat(" - Beta_Bray_BalancedVariation.csv\n")
cat(" - Beta_Bray_AbundanceGradient.csv\n")
cat(" - Beta_Bray_Total.csv\n")
Total Bray-Curtis Dissimilarity (beta.bray)
0 - Identical species abundances
0.25 - Low dissimilarity
0.50 - Moderate dissimilarity
0.75 - High dissimilarity
1- Completely different assemblages
Balanced Variation (beta.bray.bal)
Represents differences due to replacement of individuals among species between sites.
0 - No abundance replacement
0.25 - Low turnover
0.50 - Moderate turnover
0.75 - High turnover
1 - Complete replacement
Ecologically, high values indicate that species abundances are redistributed among sites rather than simply reduced.
Abundance Gradient (beta.bray.gra)
Represents differences due to abundance loss/gain.
0 - No abundance gradient
0.25 - Small abundance difference
0.50 - Moderate abundance difference
0.75 - Strong abundance gradient
1 - Extreme abundance gradient
High values suggest one community is largely a quantitatively reduced or expanded version of another.