Publications by Posts on R-hub blog

Picking and researching blog topics about R package development

08.10.2020

An alternative title for this post would be “the very meta one”. ???? In this post we shall present some principles and tips used in preparing posts on this blog, that might be useful for problem solving for R package developers and for blogging here or elsewhere. Choosing and finding relevant topics A topic is relevant if it’s related to R...

4582 sym

Helper code and files for your testthat tests

17.11.2020

If your package uses testthat for unit testing, as many packages on CRAN, you might have wondered at least once about where to put “things” you wished to use in several tests: a function generating a random string, an example image, etc. In this blog post, we shall offer a round-up of how to use such code and files when testing your package. ...

5859 sym 1 tbl

A NOTE on URL checks of your R package

30.11.2020

Have you ever tried submitting your R package to CRAN and gotten the NOTE Found the following (possibly) invalid URLs:? R devel recently got more URL checks.1 In this post, we shall explain where and how CRAN checks URLs validity, and we shall explain how to best prepare your package for this check. We shall start by a small overview of links, in...

6293 sym R (917 sym/7 pcs)

How to deal with OAuth2.0 in R packages?

24.01.2021

If you see the web API you want to wrap uses OAuth2.0 rather than a simple API key for authentication, are you happy or do you get nervous? If you get nervous, this post is for you! We shall demystify OAuth2.0 a bit so that you might know how to smoothly and securely use OAuth2.0 in your package, and we shall provide links to useful resources. Wh...

10113 sym R (960 sym/3 pcs)

RSQLite concurrency issues — solution included

12.03.2021

SQLite is a great, full featured SQL database engine. Most likely it is used more than all other database engines combined. The RSQLite R package embeds SQLite, and lets you query and manipulate SQLite databases from R. It is used in Bioconductor data packages, many deployed Shiny apps, and several other packages and projects. In this post I show...

6574 sym R (656 sym/2 pcs)

Caching the results of functions of your R package

29.07.2021

One principle of programming that’s often encountered is “DRY”, “Don’t Repeat Yourself”, that encourages e.g. the use of functions over duplicated (read: copy-pasted and slightly amended) code. You could also interpret it as don’t let the machine repeat its calculations if useless. How about for a function with the same inputs (or ...

8398 sym R (2419 sym/9 pcs)

Checking the inputs of your R functions

09.03.2022

Are you, like we were, tired of filling your functions with argument checking code that sometimes ends up being longer that the core of the function itself? Are you trying to find what is the most efficient approach to check inputs easily and without forgetting any edge cases? Read about our exploration into the various ways to check your functio...

7704 sym R (3540 sym/19 pcs)