5 min read

R package developers, why should you care about R-hub?

2019/03/26

|
|

tl;dr: You should care about R-hub if you care about R CMD check, on all operating systems, for free, and don’t ever want to leave R.

So, why use the R-hub package builder?

It is useful

As an R package developer, you probably regularly use R CMD check to detect common problems in your package, and you might even love that command. You might run it locally, or on a continuous integration platform such as Travis (Linux, macOS) or Appveyor (Windows). That’s great!

Now, how can you add a platform to your arsenal once in a while, or make sure your package will behave correctly on CRAN’s platforms? No need to borrow someone’s machine or to tweak your machine or a continuous integration config file: the R-hub package builder is there for you! R CMD check as a service on all operating systems, with platforms corresponding to different settings.

You do not need to leave R

There is an R client, rhub, allowing to manage your package builds on R-hub platforms from your R console! By default, you can follow along how your package build is going:

check log in the R console

Here’s how you’d prepare a CRAN submission by submitting your package to all 3 recommended platforms, before getting a summary of results ready to be copy-pasted into your cran-comments.md file.

chk <- check_for_cran()
# wait a bit
chk$cran_summary()
#> Updating status...
#> ## Test environments
#> - R-hub fedora-clang-devel (r-devel)
#>  - R-hub windows-x86_64-devel (r-devel)
#>  - R-hub ubuntu-gcc-release (r-release)
#> 
#> ## R CMD check results
#> ❯ On fedora-clang-devel (r-devel), windows-x86_64-devel (r-devel), ubuntu-gcc-release (r-release)
#>   checking CRAN incoming feasibility ... NOTE
#>   Maintainer: ‘Maëlle Salmon <maelle.salmon@yahoo.se>’
#>   
#>   New submission
#>   
#>   The Description field contains
#>     <http://http://cran.r-project.org/doc/manuals/r-release/R-exts.html#The-DESCRIPTION-file>
#>   Please enclose URLs in angle brackets (<...>).
#>   
#>   The Date field is over a month old.
#> 
#> ❯ On fedora-clang-devel (r-devel), windows-x86_64-devel (r-devel), ubuntu-gcc-release (r-release)
#>   checking R code for possible problems ... NOTE
#>   .bello: no visible global function definition for ‘tail’
#>   Undefined global functions or variables:
#>     tail
#>   Consider adding
#>     importFrom("utils", "tail")
#>   to your NAMESPACE file.
#> 
#> 0 errors ✔ | 0 warnings ✔ | 2 notes ✖

Find out more about rhub!

So many platforms!

Here is a view of R-hub platforms at the moment of writing.

knitr::kable(rhub::platforms(), row.names = FALSE)
Click to see a huge table.
name description cran-name rversion os-type cpu-type os-info compilers docker-image sysreqs-platform categories node-labels output-parser macos-version
debian-gcc-devel Debian Linux, R-devel, GCC r-devel-linux-x86_64-debian-gcc r-devel Linux x86_64 Debian GNU/Linux testing GCC 6.2.0 (Debian 6.2.0-6) debian-gcc-devel linux-x86_64-debian-gcc Linux linux NA NA
debian-gcc-patched Debian Linux, R-patched, GCC r-patched-linux-x86_64 r-patched Linux x86_64 Debian GNU/Linux testing GCC 6.2.0 (Debian 6.2.0-6) debian-gcc-patched linux-x86_64-debian-gcc Linux linux NA NA
debian-gcc-release Debian Linux, R-release, GCC r-release-linux-x86_64 r-release Linux x86_64 Debian GNU/Linux testing GCC 6.2.0 (Debian 6.2.0-6) debian-gcc-release linux-x86_64-debian-gcc Linux linux NA NA
fedora-clang-devel Fedora Linux, R-devel, clang, gfortran r-devel-linux-x86_64-fedora-clang r-devel Linux x86_64 Fedora 24 clang version 3.8.0; GNU Fortran 6.1.1 fedora-clang-devel linux-x86_64-fedora-clang Linux linux NA NA
fedora-gcc-devel Fedora Linux, R-devel, GCC r-devel-linux-x86_64-fedora-gcc r-devel Linux x86_64 Fedora 24 GCC 6.1.1 fedora-gcc-devel linux-x86_64-fedora-gcc Linux linux NA NA
linux-x86_64-centos6-epel CentOS 6, stock R from EPEL NA r-release Linux x86_64 CentOS 6 GCC 4.4.x centos6-epel linux-x86_64-centos6-epel Linux linux NA NA
linux-x86_64-centos6-epel-rdt CentOS 6 with Redhat Developer Toolset, R from EPEL NA r-release Linux x86_64 CentOS 6 GCC 5.2.1 centos6-epel-rdt linux-x86_64-centos6-epel Linux linux NA NA
linux-x86_64-rocker-gcc-san Debian Linux, R-devel, GCC ASAN/UBSAN NA r-devel Linux x86_64 Debian GNU/Linux testing GCC 5.4.0 (Debian 5.4.0-4) rocker-gcc-san linux-x86_64-debian-gcc Checks for compiled code linux sanitizers NA
macos-elcapitan-release macOS 10.11 El Capitan, R-release (experimental) r-release-osx-x86_64 r-release macOS x86_64 Mac OS X 10.11.6 15G1217 Apple LLVM version 8.0 (clang-800.0.42.1); GNU Fortran 4.2.3 NA osx-x86_64-clang macOS c(“macos”, “elcapitan”, “r-release”) NA elcapitan
macos-mavericks-oldrel macOS 10.9 Mavericks, R-oldrel (experimental) r-oldrel-osx-x86_64 r-oldrel macOS x86_64 Mac OS X 10.9.5 13F1911 Apple LLVM version 6.0 (clang-600.0.57); GNU Fortran 4.2.3 NA osx-x86_64-clang macOS c(“macos”, “mavericks”, “r-oldrel”) NA mavericks
solaris-x86-patched Oracle Solaris 10, x86, 32 bit, R-patched (experimental) r-patched-solaris-x86 r-patched Solaris x86_64 SunOS 5.10 Generic_147148-26 i86pc i386 i86pc GCC 5.2.0 NA solaris-10 Solaris solaris NA NA
ubuntu-gcc-devel Ubuntu Linux 16.04 LTS, R-devel, GCC NA r-devel Linux x86_64 Ubuntu 16.04 LTS GCC 5.3.1 ubuntu-gcc-devel linux-x86_64-ubuntu-gcc Linux linux NA NA
ubuntu-gcc-release Ubuntu Linux 16.04 LTS, R-release, GCC NA r-release Linux x86_64 Ubuntu 16.04 LTS GCC 5.3.1 ubuntu-gcc-release linux-x86_64-ubuntu-gcc Linux linux NA NA
ubuntu-rchk Ubuntu Linux 16.04 LTS, R-devel with rchk NA r-devel Linux x86_64 Ubuntu 16.04 LTS clang 3.8.0-2ubuntu4 ubuntu-rchk linux-x86_64-ubuntu-gcc Checks for compiled code linux rchk NA
windows-x86_64-devel Windows Server 2008 R2 SP1, R-devel, 32/64 bit r-devel-windows-ix86+x86_64 r-devel Windows x86_64 Windows Server 2008 R2 SP1 GCC 4.9.3, Rtools 3.4 NA windows-2008 Windows c(“windows”, “rtools3”) NA NA
windows-x86_64-devel-rtools4 Windows Server 2012, R-devel, Rtools4.0, 32/64 bit (experimental) NA r-testing Windows x86_64 Windows Server 2012 Rtools 4.0 NA windows-2012 Windows c(“windows”, “rtools4.0”) NA NA
windows-x86_64-oldrel Windows Server 2008 R2 SP1, R-oldrel, 32/64 bit r-oldrel-windows-ix86+x86_64 r-oldrel Windows x86_64 Windows Server 2008 R2 SP1 GCC 4.6.3, Rtools 3.3 NA windows-2008 Windows c(“windows”, “rtools3”) NA NA
windows-x86_64-patched Windows Server 2008 R2 SP1, R-patched, 32/64 bit NA r-patched Windows x86_64 Windows Server 2008 R2 SP1 GCC 4.9.3, Rtools 3.4 NA windows-2008 Windows c(“windows”, “rtools3”) NA NA
windows-x86_64-release Windows Server 2008 R2 SP1, R-release, 32/64 bit r-release-windows-ix86+x86_64 r-release Windows x86_64 Windows Server 2008 R2 SP1 GCC 4.9.3, Rtools 3.4 NA windows-2008 Windows c(“windows”, “rtools3”) NA NA

Noteworthy is the presence of

If you feel overwhelmed now (19 platforms!), fear not, we’ve written some guidance about choosing one R-hub platform.

It is free and open-source

Most of R-hub’s components are open-source, check out our GitHub organization! And all of it is accessible for free for all members of the community.

There is more (to come)

At the moment, you’d be forgiven for thinking R-hub == R-hub package builder, but stay tuned, because there’s more to come for R-hub, and for its documentation! To mention a further feature that’s already at your disposal, R-hub Linux Docker images are available for you to check your package with locally… without leaving R, once again.

Now what?

We hope you care about R-hub, and now what? Well please keep using the service, provide feedback about user experience, bugs, docs, etc. in rhub repo and ask questions on gitter. R-hub is a project for the R community, let’s keep improving it together!