This repository contains the R code to reproduce all analyses in:
Lezanby, H., Morales, M., Nel, M., Elston, C., Vargas-Fonseca, A. (2025). Preliminary survey of teleost species richness, abundance and seasonality in Plettenberg Bay using Baited Remote Underwater Video (BRUV) data. [Journal TBD].
The study investigates teleost (bony fish) community structure, species richness, and seasonal variation across reef sites in Plettenberg Bay, South Africa, using non-extractive Baited Remote Underwater Video (BRUV) sampling.
- Mario Morales – University of Arizona – ORCID: 0000-0002-0576-8655
Teleost communities in Plettenberg Bay, South Africa, were surveyed with baited remote underwater video throughout 2024 to establish a baseline for richness, diversity, and seasonal patterns. Analyses proceeded from documenting sampling to evaluate α-diversity and testing β-diversity. Sampling was uneven across sites and seasons, substantially greater at Jacobs than Meidebank, and particularly high at Jacobs in Autumn, so per-season sample sizes accompany all seasonal results. Deployment-level α-diversity was higher at Jacobs than Meidebank: species richness per deployment (median [IQR]) was 4 [5] at Jacobs (range 1–10; n=84) versus 1 [1] at Meidebank (range 1–5; n=14), a significant difference (Wilcoxon W=896.5, p=0.0015). Shannon diversity (H′) was higher in the Dry than Wet hydro-season (medians 0.872 vs 0.438; n=65 vs 33; Wilcoxon W=1375, p=0.021; permutation t=2.313, p=0.024). Community composition (Bray–Curtis on square-root transformed counts; zero-only deployments excluded) showed a hydro-season signal after accounting for location (PERMANOVA R²=0.114, F=12.52, p=0.0001), whereas location was not independently significant (R²=0.019, F=2.11, p=0.069). Constrained ordination indicated modest Dry–Wet separation with substantial overlap, consistent with detectable but moderate multivariate structuring at the deployment scale. Species-accumulation and richness-estimator diagnostics suggested near-complete sampling at Meidebank and a small number of undetected species at Jacobs. An endangered species, White Steenbras, was observed, underscoring conservation relevance. Overall, results indicate higher α-diversity at Jacobs, elevated diversity in the Dry hydro-season, and moderate hydro-season effects on community composition, all interpreted considering documented effort imbalance. These benchmarks provide a defensible baseline for long-term monitoring under increasing anthropogenic and climate pressures.
bruv-analysis/
│
├── data/
│ ├── raw/ # Data available upon publication
│ └── processed/ # Data available upon publication
│
├── scripts/
│ └── morales_teleost4.Rmd # Main analysis script (fully reproducible)
│
├── figures/ # Output figures (PNG, 300 DPI)
│ ├── Fig1_species_accumulation_all.png
│ ├── Fig2_shannon.png
│ ├── Fig3_Teleost_species_richness_by_location.png
│ ├── Fig4_shannon_by_season.png
│ ├── Fig5_shannon_diversity_by_hydroseason.png
│ ├── Fig6_CAP_by_hydroseason.png
│ ├── Fig7_CAP_by_season.png
│ ├── Fig8_SIMPER_top_contributors.png
│ └── Fig9_dispersion_by_location.png
│
├── output/ # Tables and reports (Word documents, CSV)
│
├── .gitignore # Files excluded from version control
└── README.md # This file
Data will be made available upon publication. Please check back or contact the corresponding author for updates.
Once the manuscript is published, the raw data (fishdata.csv) and processed data files required to reproduce all analyses will be added to this repository under data/raw/ and data/processed/.
For early access to the data for research purposes, please contact:
- Mario Morales – mariomorales@arizona.edu
The R Markdown script (morales_teleost4.Rmd) performs the following analyses:
| Analysis | Method | R Package |
|---|---|---|
| Species accumulation curves | Random permutation (specaccum) |
vegan |
| Richness estimation | Chao1, Jackknife (specpool, estimateR) |
vegan |
| Alpha diversity | Shannon index (H′, base e) | vegan |
| Between-group comparisons | Wilcoxon rank-sum, Kruskal–Wallis, Dunn's post-hoc | stats, FSA |
| Effect sizes | Cliff's delta, epsilon-squared | effectsize |
| Community dissimilarity | Bray–Curtis on √-transformed counts | vegan |
| PERMANOVA | Marginal tests (9,999 permutations) | vegan::adonis2 |
| Ordination | nMDS, CAP (Constrained Analysis of Principal Coordinates) | vegan |
| Taxonomic contributions | SIMPER (top ~70% contributors) | vegan |
| Beta diversity | Dispersion tests (betadisper) |
vegan |
- R ≥ 4.0.0
- RStudio (recommended) or any R environment
install.packages(c(
"tidyverse", # Data wrangling and visualization
"vegan", # Community ecology analyses
"effectsize", # Effect size calculations
"here", # Portable file paths
"officer", # Word document generation
"flextable", # Formatted tables
"lubridate", # Date handling
"mgcv", # Generalized additive models
"gratia", # GAM visualization
"FSA", # Dunn's test
"MKinfer" # Permutation t-tests
))-
Clone or download this repository:
git clone https://github.com/yeridu/bruv-analysis.git
-
Obtain the data by contacting the authors (data will be publicly available upon publication)
-
Place data files in the appropriate folders:
data/raw/fishdata.csvdata/processed/deployments.csv
-
Open the project in RStudio by double-clicking
bruv-analysis.Rproj -
Run the analysis by opening
scripts/morales_teleost4.Rmdand clicking Knit, or run:rmarkdown::render("scripts/morales_teleost4.Rmd")
-
Outputs will be generated in
figures/(PNG) andoutput/(Word documents, CSV tables)
This project uses the here package for file paths. The analysis will run on any operating system (Windows, macOS, Linux) without modification.
All analyses follow reporting guidelines recommended by:
- ARRIVE 2.0 for ecological research
- TOP Guidelines for transparency and openness
Key statistical details:
- Seed for reproducibility:
set.seed(42)used for all permutation-based tests - Permutations: 9,999 for PERMANOVA and permutation tests
- Confidence intervals: 95% throughout
- Effect sizes: Reported alongside p-values per modern best practices
- Multiple comparisons: Benjamini–Hochberg (FDR) correction for post-hoc tests
This work is licensed under a Creative Commons Attribution 4.0 International License.
If you use this code, please cite:
Lezanby, H., Morales, M., Nel, M., Elston, C., Vargas-Fonseca, A. (2025).
Preliminary survey of teleost species richness, abundance and seasonality
in Plettenberg Bay using Baited Remote Underwater Video (BRUV) data:
Code repository. GitHub. https://github.com/yeridu/bruv-analysis
For questions or collaboration inquiries:
- Mario Morales
- Email: mariomorales@arizona.edu
- GitHub: @yeridu
Last updated: January 2025