flowchart LR A[Alessandro v1] --> B[Alessandro v2] B --> C[Alessandro v3] B --> D[Audrey v1] D --> E[Audrey + Alessandro v4] C --> E
openstatsware
short course: Good Software Engineering Practice for R Packages
August 24, 2025
Any opinions expressed in this presentation and on the following slides are solely those of the presenter and not necessarily those of their employers.
Photo by Rich @ rhubbardstockfootage on Unsplash
Key issue:
Manage complexity over time or between people
Photo from Tim Mossholder on Unsplash
No matter how a group is organised, the work of many contributors often needs to be combined into a single set of shared working documents
Managing changes/revisions to these documents is called versioning
flowchart LR A[Alessandro v1] --> B[Alessandro v2] B --> C[Alessandro v3] B --> D[Audrey v1] D --> E[Audrey + Alessandro v4] C --> E
Photo by Lf Asia & the Archive Team CC BY 3.0
git verb options
git
invokes Gitverb
is a placeholder for the different actions (such as branch
or commit
, more on that later)options
is a placeholder for any option possibly required by a certain verb
(not always required)git help
is your friend!gitGraph commit commit commit commit commit
\(\leadsto\) Chain of versions with incremental changes
Photo by Felicia Montenegro on Unsplash
git checkout [commit hash to browse]
git reset --hard [commit hash to reset to]
my-file_final_v2_2019.R
Photo by Mila Tovar on Unsplash
gitGraph commit commit branch feature checkout feature commit commit checkout main commit
git branch [my new branch name]
git branch
git checkout [branch name]
Photo by Mila Tovar on Unsplash
gitGraph commit commit branch feature checkout feature commit commit checkout main commit merge feature
Photo by Max LaRochelle on Unsplash
gitGraph commit tag: "v0.0.1" commit branch feature-1 checkout feature-1 commit commit checkout main branch feature-2 checkout feature-2 commit checkout feature-1 commit checkout main commit tag: "bugfix" merge feature-1 tag: "v0.1.0" checkout feature-2 commit
sequenceDiagram participant A as Alessandro participant GH as GitHub server participant B as Audrey A->>A: make change locally & commit to <feature> A->>GH: push commit A->>GH: open pull request GH->>GH: run automated checks A->>B: request review B->>B: review code B->>A: request changes A->>A: implement changes locally & commit A->>GH: push commit GH->>GH: run automated checks A->>B: request review B->>B: review code B->>GH: approve changes, unblocking merge A->>GH: merge <feature> into <main> GH->>GH: run automated checks on <main> B->>GH: pull newest version of <main>
\(\leadsto\) Making collaboration on code scalable
In the current version, changes were done by (later authors): Daniel Sabanés Bové , Alessandro Gasparini
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.
The source files are hosted at github.com/openstatsware/shortcourse-iscb2025, which is forked from the original version at github.com/RCONIS/workshop-r-swe-zrh.
Important: to use this work you must provide the name of the creators (initial authors), a link to the material, a link to the license, and indicate if changes were made.