Does your package need the user to provide secrets, like API tokens, to work? Have you considered telling your package users about the keyring package, or even forcing them to use it? The keyring package maintained by Gábor Csárdi is a package that accesses the system credential store from R: each operating system has a special place for storing secrets securely, that keyring knows how to interact with. The credential store can hold several keyrings, each keyring can be protected by a specific password and can hold several keys which are the secrets.

Read more...

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 out cli in your package! This post was featured on the R Weekly highlights podcast hosted by Eric Nantz and Mike Thomas.

Read more...

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 packages integrating CUDA GPU computation in R require the CUDA library. In particular, we are going to talk about system dependencies in the context of automated testing: is there anything extra to do when setting continuous integration for your package with system dependencies?

Read more...

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 contributors can build with and upon it as needed.

Read more...

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 avoid very complicated infrastructure, as a complement to mocking in your toolbelt.

Read more...