1 Introduction

openstatsware short course: Good Software Engineering Practice for R Packages

Daniel Sabanés Bové

July 17, 2026

Welcome to GSWEP4R at SAIHST!

삼성헬스케어과학기술원(SAIHST)에서 주최하는 R 패키지 활용 우수 소프트웨어 엔지니어링 실무 워크숍에 오신 것을 환영합니다! 🇰🇷

I have enjoyed the 33rd International Biometric Conference in Seoul and am looking forward to teaching today’s workshop! 😄

Big thanks to Sang Ho Park for the local organization 🙏

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 🧠

A couple of advance questions

For someone with no prior background in programming, approximately how long would it take to reach a competent amateur level — several months or several years?

Depends on the fluency level and how intensive your learning program is. You can compare it to learning a foreign language:

  • A 6 months intensive course, 30 hours per week, can get you to a daily conversational level quickly.
  • If you only spend 1 hour per week, it will take you several years to reach the same level, or you might never reach it at all.
  • But if you knew already a (similar) programming language, you could reach the competent amateur level much faster.

A couple of advance questions (cont’d)

Although people often say that AI can now generate most of the code, which aspects of R should a beginner focus on to become genuinely comfortable and proficient with the language?

I would recommend to focus on the basic R programming concepts first, including:

  • Read / Eval / Print Loop (REPL)
  • Vectors, lists, and data frames
  • Functions
  • Control flow

And then dive deeper into the R package ecosystem relevant to your work.

A couple of advance questions (cont’d)

In the age of foundation models, what capabilities or roles do you think will remain uniquely important for human biomedical researchers?

Personally I think AI systems are still far away from artificial general intelligence (AGI) and true “understanding” or “reasoning” and even “learning”. Therefore, researchers still need to:

  • truly understand the basic concepts of their field
  • communicate with other disciplines and stakeholders
  • strategically plan and intuitively innovate their research

A couple of advance questions (cont’d)

For early-career biomedical researchers who hope to work globally in computational genomics and translational medicine, which skills and research experiences should they prioritize over the next few years?

I am not an expert in that field in particular, but I hope the previous remarks are helpful as a start.

A couple of advance questions (cont’d)

How do industry and academia differ in their use of AI and bioinformatics tools?

For bioinformatics tools I am not an expert. Otherwise I have the impression that industry is starting to use AI tools quickly, while academia can be slower and more cautious.

A couple of advance questions (cont’d)

Expert prior elicitation methods such as SHELF were originally developed largely in fields such as clinical trials. Do you think these methods can also work effectively in areas such as consumer research or marketing, where expert judgment may be more uncertain and the available data are often noisier? When applying these methods to a different domain, how much of the elicitation process or methodological framework would need to be redesigned?

I think many methods developed for clinical trials can be applied to experiments in other areas (that is e.g. my experience when I worked at Google). However, the business is quite different and there are less rigorous regulations outside of clinical trials. Therefore, the level of rigor being used is typically lower. On the other hand, there is more freedom to try out new methods in these other domains.

License information