Code repository for Vihtakari et al. (2026): Demersal distribution and fisheries‑independent trends of beaked and golden redfish in the Barents and Norwegian Seas. ICES Journal of Marine Science. https://doi.org/10.1093/icesjms/fsag009
The goal is not to reconstruct the published paper results exactly. The paper used internal and partly restricted data. This public workflow demonstrates the model structure on an updated, curated dataset with Russian data excluded by default.
The Quarto documents in docs/SI files/ are the supplementary-information text of the paper and are the primary demonstration of how the survey index was calculated:
SI-Text-1-data.qmd— dataSI-Text-2-sdmTMB.qmd— spatiotemporal modellingSI-Text-3-model-selection.qmd— model selectionSI-Text-4-length-based-models.qmd— length-based models for redfishSI-Text-5-bottom-temperature.qmd— bottom temperature modelling
They render against the public data in data/public/ and the showcase model outputs, and share a bibliography and citation style file kept at data/bibliography/.
docs/data/ holds the original data-compilation notebooks used to extract and prepare source survey data from the IMR BioticExplorerServer database. They only run on computers with local access to that database and depend on R/read_spd_1_6.R and R/run_first_bes.R. They are kept for reference/reproducibility of the data-compilation steps described in the paper; they are not required to run the public showcase workflow below.
The public analysis starts from sanitized station-level files in data/public/. A matching public dataset is intended to be available from NMDC: https://doi.org/10.21335/NMDC-999805712.
When data/survey data/Compiled_redfish_survey_data.rda is present, the public-prep step uses that compiled survey source directly before applying the spatial public filter.
Russian data are excluded by default using:
- a study-area polygon stored at
data/gis/study area.gpkg, - a Russian EEZ polygon stored at
data/gis/russian_eez.shp.
IMR users who are allowed to work with the restricted data can rerun the pipeline with INCLUDE_RUSSIAN_DATA=true. This switch is intentionally opt-in.
Install dependencies from renv.lock when available, then run:
source("run_analysis.R")The default model run is a quick, rerunnable showcase. To attempt the larger model fit, set SMOKE_TEST=false.
For IMR-internal data refreshes, set the path to a local BioticExplorerServer DuckDB database before running:
export UPDATE_BES=true
export BES_DATABASE_PATH="paste your BES database path here"The local DuckDB path is deliberately not stored in the repository.
The workflow writes:
- sanitized station data to
data/public/, - sanitized length data unless
INCLUDE_LENGTH_DATA=false, - a cruise summary with an automatically updated
includedcolumn, - a filtered station map to
figures/, - duplicate and exclusion review tables,
- showcase model outputs under
output/.
review/ and output/ are local QA products and are ignored by Git unless explicitly reviewed for public release.