Publications by Posts on R-hub blog
R-hub v2
After eight years, we are retiring the current version of R-hub, in favor of a better, faster, modern system. We call the new system R-hub v2. R-hub v2 runs R package checks on GitHub Actions. R-hub v2 works best if your R package is in a GitHub repository. This post helps you transition to R-hub v2 from the previous version. TL;DR Is your package ...
6963 sym R (4735 sym/11 pcs)
Update on mocking for testing R packages
This blog featured a post on mocking, the art of replacing a function with whatever fake we need for testing, years ago. Since then, we’ve entered a new decade, the second edition of Hadley Wickham’s and Jenny Bryan’s R packages book was published, and mocking returned to testthat, so it’s time for a new take/resources roundup! Thanks a lot...
5392 sym Python (1761 sym/11 pcs)
Cliff notes about the cli package
We’ve both coincidentally dipped our toes in the wonderful world of pretty messaging with cli. cli::cli_alert_success("marvellous package adopted!") #> ✔ marvellous package adopted! In this post, we transform the hurdles we encountered in a series of tips so that your own journey might be slightly smoother, and also to encourage you to try ou...
6780 sym R (2015 sym/8 pcs)
System Dependencies in R Packages & Automatic Testing
This post has been cross-posted on the Epiverse-TRACE blog. In a previous post, we discussed a package dependency that goes slightly beyond the normal R package ecosystem dependency: R itself. Today, we step even further and discuss dependencies outside of R: system dependencies. This happens when packages rely on external software, such as how R p...
9469 sym Python (2873 sym/7 pcs)
A testing pattern: adding switches to your code
Sometimes, testing gets hard. For instance, you’d like to test for the behavior of your function in the absence of an internet connection, or in an interactive session, without actually cutting off the internet, or from the safety of a definitely non interactive R session for tests. In this post we shall present a not too involved pattern to av...
3329 sym R (898 sym/5 pcs)
Why comment your code as little (and as well) as possible
When I first started programming, I clearly remember feeling I had to add comments, that would repeat exactly what the code below was doing, as if it were the script for some sort of voice over. I want you to know like I now do that it’s not the way to comment one’s code. 😅 An important goal of good code is to be readable so that future co...
5193 sym R (409 sym/5 pcs)
Minimum R version dependency in R packages
There have been much talk and many blog posts about R package dependencies. Yet, one special dependency is more rarely mentioned, even though all packages include it: the dependency on R itself. The same way you can specify a dependency on a package, and optionally on a specific version, you can add a dependency to a minimum R version in the DESC...
11112 sym R (6936 sym/10 pcs)
Mocking is catching
When writing unit tests for a package, you might find yourself wondering about how to best test the behaviour of your package when the data it’s supposed to munge has this or that quirk, when the operating system is Windows, when a package enhancing its functionality is not there, when a web API returns an error; or you might even wonder how ...
5705 sym R (820 sym/2 pcs)
Search and discover CRAN packages with pkgsearch!
We have just released version 3.0.1 of the pkgsearch package on CRAN! ???? pkgsearch munges CRAN metadata and lets you access it through several lenses: search packages by keyword, popularity, recent activity, package name and more. Get pkgsearch’s latest version from a safe CRAN mirror near you: install.packages("pkgsearch") This release, com...
3758 sym R (4958 sym/7 pcs) 2 img
The Rt of good package READMEs
A recent topic of the Write The Docs’ great newsletter was READMEs. It read “As they’re often the first thing people see about a code project, READMEs are pretty important to get right.”. In this post, we’ll share some insights around the READMEs of R packages: why they’re crucial; what they usually contain; how you can best write you...
8641 sym R (10569 sym/19 pcs) 2 img 1 tbl