6 Conclusion
openstatsware
short course: Good Software Engineering Practice for R Packages
August 24, 2025
Disclaimer
Any opinions expressed in this presentation and on the following slides are solely those of the presenter and not necessarily those of their employers.
Thank you …
- to you for your engagement and participation 🙏
- to the ISCB organizers to make this event possible 👏
- to our fellow
openstatsware
authors of the course materials 📚
R package structure
- R package = folder structure with (many) conventions
- With modern tools
usethis
, roxygen2
it is easy to start a new package
- Packaging a set of functions is an ideal way to share with collaborators and the public
- Start small and simple and over time you can learn additional options
Ensuring quality
- Quality by Design: use a workable workflow:
Idea \(\rightarrow\) Design docs \(\rightarrow\) Programming \(\rightarrow\) Quality check \(\rightarrow\) Publication
- Apply common clean code rules:
- Use clear names for functions and variables
- Don’t repeat yourself!
- Use styler to optimize the code styling
- Write tests for your functions
- Use testthat to test, test, and test
- Use covr to improve the test coverage
Collaboration
- Version control is key
- Multiple people working on code without strong VC \(\leadsto\) disaster!
- There are different options, but git is the defacto standard for R packages
- Git needs a friend - use platforms like GitHub or GitLab
- Automated CI/CD allows for much quicker iteration
- Automate tests to avoid bugs slipping back in
- Technology does not solve everything - foster a positive culture
- Keep internal and external contributors engaged
- Invest in documentation to make it easier to contribute
Publication
pkgdown
can help you easily create a nice website for your package
- Versions and licenses along with
NEWS
updates are important
- GitHub helps with tagging of release versions
- R-Hub helps with checking before CRAN submission
Possible next steps
- Bring the information back to your colleagues in your organization
- Start building your first own package and share internally first
- Later publish it open source on GitHub and submit it to CRAN
- Learn about more tips and tricks how to extend R
![]()
Photo by Pixabay on pexels.com