1 Introduction

openstatsware short course: Good Software Engineering Practice for R Packages

Daniel Sabanés Bové

August 13, 2026

Welcome to GSWEP4R at LMU Munich!

Welcome to the Good Software Engineering Practice for R Packages workshop at the Department of Statistics! 🇩🇪

It is a personal highlight for me to teach today’s workshop at my alma mater! 😄

Big thanks to the Department of Statistics at LMU Munich for hosting us! 🙏

Daniel Sabanés Bové

Feel free to connect
  • Ph.D. in Statistics from University of Zurich, Bayesian Model Selection
  • Biostatistician at Roche for 5 years, Data Scientist at Google for 2 years, Statistical Software Engineer at Roche for 4 years
  • Happy Taipei expat since summer 2024, where I started roadbiking 🚴‍♀️
  • Co-founder of inferential.bio, RCONIS and partner at RPACT
  • Multiple R packages on CRAN and Bioconductor, co-wrote book on Likelihood and Bayesian Inference, chair of openstatsware

openstatsware

  • openstatsware.org
  • Since: 19 August 2022 - already 4 years now!
  • Where: American Statistical Association (ASA) Biopharmaceutical Section (BIOP), European Federation of Statisticians in the Pharmaceutical Industry (EFSPI)
  • Who: Currently more than 40 statisticians from more than 30 organizations
  • What: Engineer packages and promote best practices

What you will learn here

  • Understand the basic structure of an R package
  • Create your own R
  • Learn about & apply professional development workflow
  • Learn & apply fundamentals of quality control for R
  • Get crash-course in version control and modern collaboration techniques on GitHub.com
  • Learn how to make an R available to others

Do we still need to learn this - AI can do it?

  • In the past, carpenters exclusively used saw, hand drill, and hammer
  • For a long time now, we have power tools, like electric saws and drills
  • And we have had computer aided design (CAD) software for decades
  • We have even 3D printers, which can produce furniture directly
  • Nevertheless, carpenters still start their apprenticeship by learning how to use a saw and hammer, and build furniture by hand
  • In the same way, we still need to learn the basics of good software engineering, even though AI tools can help us later to execute the work faster and more efficiently

What do we mean by GSWEP4R*?

  • Applying concept of “Good XYZ Practice” to SWE with R
  • Improve quality and longevity of R code/packages
  • Not a universal standard; we share our perspectives
  • Collection of best practices
  • Do not reinvent the wheel: learn from the community

Why care about GSWEP4R?

  • R is one of the most successful statistical programming languages
  • R is a powerful yet complex ecosystem
    • Core component: R packages
    • Mature user & contributor community
    • Where deeper understanding is crucial, even to just assess quality
  • Analyses increasingly require complex scripts/programs
  • The concepts are applicable to other languages, too (Python, Julia, etc.)

Start small - from script to package

  1. Encapsulate behavior (functions)
  2. Avoid global state/variables
  3. Adopt consistent coding style
  4. Document well
  5. Add test cases
  6. Refactor and optimize code
  7. Version your code
  8. Share as ‘bundle’

\(\leadsto\) R package

Program outline

9.00 - 9.15 Introduction and outline
9.15 - 10.00 R package syntax
10.00 - 10.30 Exercise
10.30 - 11.00 Coffee break
11.00 - 11.45 Package quality
11.45 - 12.30 Exercise
12.30 - 13.30 Lunch break
13.30 - 14.15 Collaboration via GitHub
14.15 - 15.00 Exercise
15.00 - 15.30 Coffee break
15.30 - 16.15 Publication of R packages
16.15 - 16.45 Exercise
16.45 - 17.00 Summary and Q&A

House-keeping

What you will need

  • Github.com (free) account
  • Local R development environment with
    • git
    • Rtools/R/Rstudio IDE
  • Install additional R packages using the installation script
  • Curiosity 🦝

Speed intros and what would you like to learn?

  • Name? 🌏
  • Organization? 🏢
  • Motivation for this workshop/ what would you like to learn 🧠

License information