Data and code from: Environmental and protection effects of shark-companion associations across three ocean basins
Data files
Jun 10, 2026 version files 445.49 KB
-
companion_associations_2026.R
28.52 KB
-
manuscript_main_analysis_datafiles.xlsx
277.96 KB
-
No_Outliers.csv
131.08 KB
-
README.md
7.93 KB
Abstract
This repository contains the datasets and R code used in the manuscript "Environmental and Protection Effects of Shark-Companion Associations Across Three Ocean Basins". The repository includes both processed and raw observational datasets, environmental predictor variables, species-level metadata, and the primary statistical analysis scripts used in the study. The main analytical dataset is provided in the file “No_Outliers.xlsx”, which contains the curated data used for final modelling analyses, while “manuscript_main_analysis_datafiles.xlsx” contains the complete compiled dataset, including both used and excluded observations. The datasets include records of companion abundance associated with shark hosts, alongside biological and environmental variables such as host species identity, sea surface temperature, salinity, depth, dissolved oxygen, primary productivity, wind conditions, and spatial metrics including distance from shore and distance to port. Variables related to marine protection status and vulnerability categories are also included. Data values consist primarily of integer abundance counts, categorical species and protection classifications, and continuous environmental measurements. The accompanying R scripts reproduce the full analytical workflow, including hurdle negative binomial modelling, model selection using AICc and BIC approaches, cross-validation, calibration analyses, receiver operating characteristic (ROC) analyses, and generation of figures and partial effect plots. Outputs are reproducible using R (version 4.3 or later) and the packages specified within the scripts. Data were derived from non-invasive marine ecological observations and do not contain personally identifiable or sensitive information. Users should cite the associated manuscript when reusing the data or analytical code.
Dataset DOI: 10.5061/dryad.rr4xgxdpm
Description of the data and file structure
These data were collected as part of a global study investigating associations between shark hosts and companion species across three ocean basins. Observations were compiled from standardized marine video surveys and associated environmental datasets to examine patterns in companion abundance and distribution relative to shark species, environmental conditions, and spatial variables. The study combined biological observations with environmental and spatial predictor variables, including sea surface temperature, salinity, dissolved oxygen, primary productivity, depth, wind conditions, distance to shore, and distance to port. Additional variables describing marine protection and vulnerability classifications were included to assess potential ecological and management influences on companion associations.
Files and variables
File: No_Outliers.csv
Description: Curated dataset used for all final statistical analyses and modelling presented in the manuscript. The dataset contains cleaned observational records after removal of identified outliers and incomplete records used during model fitting and validation procedures.
Variables
Op_Code– Unique observation or deployment identifierHost_Name– Common name of shark host speciesFamily– Taxonomic family of host speciesSpecies– Scientific name of shark host speciesLoc– Sampling locationRegion– Geographic regionOcean– Ocean basinSizeClass– Host size classification categoryFl(cm)– Fork length of host individual (cm)Comp_Abund– Companion abundance countSpecies– Shark host species identitywindU– Wind U-componentwindV– Wind V-componentSST– Sea surface temperaturelogDepth– Log-transformed depthlogSalinity– Log-transformed salinitylogPP– Log-transformed primary productivitylogPPsquared– Squared log-transformed primary productivity termlogDFS– Log-transformed distance from shorelogDTP– Log-transformed distance to portOxy– Dissolved oxygenlogCHl– Log-transformed chlorophyll concentrationDVHP– High protection category classificationDVPP– Vulnerability/protection category classification
Note: the column host fork length contains N/A values in cases where measurements could not be taken. this column is not used in the final analysis.
File: manuscript_main_analysis_datafiles.xlsx
Description: Complete compiled dataset containing all collected observational data associated with the study, including both records retained and excluded from final analyses. This file serves as the master dataset archive for the project.
Variables
- Op_Code – Unique deployment or observation identifier for each BRUVS sample
- Protected – Protection status of the sampling location (e.g., protected or unprotected area)
- Host – Scientific name of the shark host species
- Host_Name – Unique identifier assigned to each host shark individual
- NumCompanions – Total number of companion individuals associated with the host
- ComDiversity – Number of companion species associated with the host (species richness)
- LengthH(mm) – Estimated length of the host shark (mm)
- Host_Surface_Area – calculated body surface area of the host shark (m²)
- Companion – Scientific name of the companion species
- Companion_Name – Unique identifier assigned to each companion individual
- Num – Number of individuals represented by the observation record
- lengthC(mm) – Estimated length of the companion individual (mm)
- DistanceFromHost(mm) – Distance between the companion and host individual (mm)
- Appendage – Host body region or appendage nearest to the companion (e.g., head, dorsal fin, pectoral fin, trunk, caudal fin)
- ActivityC – Behavioural activity category recorded for the companion individual
- dist_port_KM – Distance from the sampling location to the nearest port (km)
- chlorophyll – Surface chlorophyll-a concentration (mg m⁻³)
- primary-production – Primary productivity at the sampling location (mg C m⁻² day⁻¹)
- oxygen – Dissolved oxygen concentration (mmol m⁻³)
- Dist_from_shore_KM – Distance from the sampling location to the nearest shoreline (km)
- Depth_M – Seafloor depth at the sampling location (m)
- Salinity – Sea surface salinity (Practical Salinity Units, PSU)
- SST – Sea surface temperature (°C)
Note: N/A values in cases where measurements could not be taken.
File: companion_associations_2026.R
Description: Main R analysis script used to conduct statistical analyses and generate outputs for the manuscript. The script performs data loading, preprocessing, hurdle negative binomial modelling, model selection, cross-validation, calibration analyses, ROC/AUC diagnostics, and figure generation. The script was developed for use with R version 4.3 or later and requires the R packages listed within the script header.
Code/software
All datasets are provided in Microsoft Excel (.xlsx) format and can be viewed using Microsoft Excel, LibreOffice Calc, Google Sheets, or other spreadsheet software capable of reading .xlsx files.
All analyses were conducted in R version 4.3 or later using the script:
companion_associations_2026.R
The analytical workflow included:
- Data import and preprocessing
- Data cleaning and outlier removal
- Hurdle negative binomial model fitting
- Model selection using AICc and BIC
- Cross-validation and calibration analyses
- ROC/AUC diagnostic analyses
- Generation of partial effect plots and manuscript figures
The primary input dataset for analyses was:
No_Outliers.xlsx
Required R packages include:
readxldplyrtidyrtibblepurrrglmmTMBAICcmodavggluefurrrfutureR.utilspsclreadrcaretpROCggplot2patchworkscales
Outputs generated by the script include model rankings, cross-validation statistics, calibration plots, ROC analyses, and partial effect figures saved to the designated output directory.
Access information
Other publicly accessible locations of the data:
- GitHub repository containing datasets, analysis scripts, and project documentation:
https://github.com/JettWalker/companion_associations_2025
Data was derived from the following sources:
- Data on companions and hosts were compiled from standardized marine ecological observation datasets from BRUVS (Baited Remote Underwater Video Systems). all data was collected by the Marine Futures Lab at the University of Western Australia (https://www.meeuwig.org/)
- Environmental predictor variables were derived from publicly available global oceanographic and spatial datasets from Copernicus Marine (https://marine.copernicus.eu/access-data/), as well as geospatial marine datasets from GEBCO (General Bathymetric Chart of the Oceans) (https://www.gebco.net/) and Global Fishing Watch (https://globalfishingwatch.org/)
License information:
All original data and code associated with this repository are provided for research and educational purposes. Users should cite the associated manuscript and repository when reusing these materials. Third-party environmental datasets remain subject to their original licensing and attribution requirements.
