A walkthrough of the various packages, tools, resources, and axioms I have encountered over my years as an R package sofware engineer.
People who program using the R language can be separated into two core buckets:
To distinguish, R developers develop new innovative solutions while R Users use the tools and packages that the developers created. This article is aimed towards the development side of the spectrum and attempts to provide a comprehensive, curated toolbox for the R Developer, specifically in regard to developing R Packages.
To start, R package developers need to be familiar with the fundamentals of package development, and therefore should be familiar with some of the highest regarded resources available to read.
Anyone who is serious about developing production grade R packages needs to be familiar with most of, if not all of the following resources and guides:
Resource | Source |
---|---|
Writing R Extensions | CRAN Manuals |
R Packages | Hadley Wickham |
R Package Primer | Karl Broman |
Package Guidelines | Bioconductor |
rOpenSci Packages Developer Guide | rOpenSci |
(Wickham and Bryan, n.d.a, n.d.b; “Why Package and Environment Management Is Critical for Serious Data Science,” n.d.a, n.d.b; Vidoni, n.d.; Initiative, n.d.; “An Introduction to Packager,” n.d.; Gandrud 2015; Glennie 2020; “Owen-TheRGuide.pdf,” n.d.; Riederer, n.d.; Spector 2004; Team, n.d.; Zhu and Jianan, n.d.)
The Writing R Extensions Manual is perhaps the most crucial resource listed above, and has even been considered the Bible of R Package Development.
However, it is very exhaustive and not the most visually-appealing write-up.
As Hadley puts it in his book Writing R Packages: (Wickham and Bryan, n.d.c)
“The best resource for the official details of package development is always the official writing R extensions manual. However, this manual can be hard to understand if you’re not already familiar with the basics of packages. It’s also exhaustive, covering every possible package component, rather than focusing on the most common and useful components, as this book does. Writing R extensions is a useful resource once you’ve mastered the basics and want to learn what’s going on under the hood.”
Thanks to Colin Fay, a more elegant version of the original manual has been created as a bookdown site and published online at https://colinfay.me/writing-r-extensions.
This resource is highly encouraged for anyone taking R Package Development seriously.
Note: The other manuals listed on the CRAN Manuals website contain a lot of hidden gems that are often overlooked by R developers. These resources contain some of the most crucial, foundational knowledge that anyone using R should eventually be made aware of, therefore I highly recommend you check those out in addition to Writing R Extensions.
R Package development can be broken down into the following fundamental areas of development:
If you see mistakes or want to suggest changes, please create an issue on the source repository.
For attribution, please cite this work as
Briggs (2021, Dec. 18). Jim's Docs: R Package Developer Essentials. Retrieved from https://jimsdocs.jimbrig.com/posts/2021-12-18-2-r-package-developer-essentials/
BibTeX citation
@misc{briggs2021r, author = {Briggs, Jimmy}, title = {Jim's Docs: R Package Developer Essentials}, url = {https://jimsdocs.jimbrig.com/posts/2021-12-18-2-r-package-developer-essentials/}, year = {2021} }