Good Software Engineering Practice for R Packages
August 1, 2024
Any opinions expressed in this presentation and on the following slides are solely those of the presenter and not necessarily those of their respective employer or company.
Photo by Rich @ rhubbardstockfootage on Unsplash
Key issue:
Manage complexity over time or between people
Photo from Tim Mossholder on Unsplash
Photo by Lf Asia & the Archive Team CC BY 3.0
\(\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
git checkout -b [my new branch]
git checkout [branch name]
Photo by Mila Tovar on Unsplash
Photo by Max LaRochelle on Unsplash
\(\leadsto\) making code-collaboration scalable
README.md
file and set up your environment in posit cloudVersion
field defines the package version.
or -
x.y-z
, equivalent to x.y.z
x
is major: Increment this for breaking changesy
is minor: Increment this for new featuresz
is patch: Increment this for bug fixes onlyx.y.z.9000
and count up during developmentusethis::use_version()
can help with thisvx.y.z
remotes::install_github("org/package", ref = "vx.y.z")
tar.gz
package files are rarely used directly