Reproducible Research in R

RaukR 2026 • Data Science With R

Roy Francis

18-Aug-2026

Contents

  • Why reproducibility matters in computational research
  • Reproducibility steps and guidelines
  • Tools and resources for reproducible research in R

What’s all the fuss about?

Reproducibility crisis?

What is Reproducibility?

A study is reproducible when someone else (or future you) can obtain the same results using the same data and code.

Why Does It Matter?

The problem:

  • “Works on my machine” syndrome
  • Package versions change silently
  • Analysis steps are scattered in scripts
  • No clear record of what ran when
  • Collaborators cannot reproduce your work

The cost:

  • Retraction Watch records thousands of retractions
  • Irreproducible preclinical research costs billions of dollars per year
  • Time wasted re-running broken analyses

Steps in reproducible research

  1. Literate programming
  2. Code version control and sharing
  3. Compute environment control
  4. Persistent data sharing (FAIR principles)
  5. Documentation

Ziemann et al. (2023) Hornung et al. (2026)

The Reproducibility Stack

A project needs several layers of reproducibility:

  • Version control.
    Git
  • Share and track code.
    GitHub, GitLab, Bitbucket
  • Packages and environment manager.
    renv, uvr, rv, Conda, Pixi, Nix, rix
  • Notebooks and documentation.
    Jupyter, RMarkdown, Quarto, LaTeX, workflowr
  • Containerized computing environment.
    Docker, Apptainer
  • Pipelines and workflow manager.
    Snakemake, Nextflow, targets
  • Continuous integration and deployment.
    GitHub Actions, Gitlab CI/CD, Jenkins, Travis CI
  • Data storage and sharing.
    Zenodo, Dryad, OSF, Dataverse, Figshare

Code • Be kind to future you

  • Write modular, reusable functions instead of long scripts
  • Use informative and consistent naming and style guides (e.g., tidyverse style guide)
  • Set seed for reproducibility of random processes
  • Separate configuration / settings from code
  • Use version control (Git) for code and documents
  • Host code in a public repository (GitHub, Gitlab, Bitbucket) for backup and collaboration
  • Projects should be self-contained and portable
    • Use project root as the reference point
    • Use relative paths instead of absolute paths for file access
    • Avoid setwd() to local paths in code

Your most demanding collaborator is future you, who remembers nothing.

Environment • Capture the recipe and the kitchen

  • Use a package manager (renv, uvr, rv, Conda, Pixi, Nix, rix) to manage dependencies
  • Use a workflow manager (targets, Snakemake, Nextflow) to automate analysis pipelines
  • Automate analyses instead of relying on manual steps and interactive point-and-click
  • Record all analysis parameters and software versions
    • Add session info to reports and notebooks
  • Containerize the computing environment (Docker, Apptainer) for reproducibility across systems
  • Add clear documentation and README files to explain how to run the analysis

“Works on my machine” is not a reproducibility strategy.

Data • Sharing is caring

  • Store data in a structured and organized manner
  • Prefer open formats (CSV, TSV, Parquet) over proprietary formats (Excel, SPSS, SAS)
  • Use a data management plan (DMP) to outline how data will be collected, stored, and shared
  • 3-2-1 data backup rule: 3 copies, 2 storage media, 1 off-site
  • Separate raw and processed data
  • Share data and code in a FAIR manner (with DOI if possible)
  • Use a data repository (Zenodo, Dryad, OSF, Dataverse, Figshare) to share data

“Your downloads folder is not a data repository.”

Further Reading

References

Alston, Jesse M, and Jessica A Rick. 2021. “A Beginner’s Guide to Conducting Reproducible Research.” Bulletin of the Ecological Society of America 102 (2): 1–14. https://doi.org/10.1002/bes2.1801.
Banzi, Rita, Monika Varga, Yuri Andrei Gelsleichter, et al. 2026. “An International Consensus on Core Reproducibility Items in Research.” Plos Biology 24 (4): e3003726. https://doi.org/10.1371/journal.pbio.3003726.
Gandrud, Christopher. 2020. Reproducible Research with r and RStudio. Crc Press.
Hornung, Roman, László Németh, Oleksandr Zadorozhnyi, et al. 2026. “Overcoming Barriers to Computational Reproducibility.” Royal Society Open Science 13 (6): 252489. https://doi.org/10.1098/rsos.252489.
Schweinberger, Martin. 2026. Reproducible Research: Principles and Practice. 3.1.1. The Language Technology; Data Analysis Laboratory (LADAL), The University of Queensland, Australia. https://doi.org/10.5281/zenodo.19332951.
Ziemann, Mark, Pierre Poulain, and Anusuiya Bora. 2023. “The Five Pillars of Computational Reproducibility: Bioinformatics and Beyond.” Briefings in Bioinformatics 24 (6): bbad375. https://doi.org/10.1093/bib/bbad375.

Thank you!

Questions?

2026 • SciLifeLabNBISRaukR