Packages in non-standard repositories: What to do when submitting your own R package to CRAN

I’m currently finalising the submission of my packages FRK to CRAN. It depends on several packages, but not all of these are available on CRAN. Now, CRAN requires packages that are not available in mainstream repositories to be put into their own repositories, and their URLs then need to be specified in the Additional_respositories in the Description; see the package DESCRIPTION for an example.

If your aspiring CRAN package depends on a home-brewn package that will never make it to CRAN (e.g., a data package), then it needs to be put into its own repository. This seemed duanting to me until I came across this website here which explains how to construct your own repository on github pages. Basically the steps are as follows

  1. Create a new repo on github
  2. Create a repo of the same name using the instructions in the webpage
  3. Push the changes to the gh-pages branch

The last step is important; if these are not put in the gh-pages branch then these will not be visible by R CMD check.

One thing which took some time to figure out (thanks to Clint Shumack for helping me out) was that R CMD check was only checking for repos with http… unfortunately gh-pages enforces https. This, however, was because my R was outdated. As from R 3.3 R CMD check has full support for repositories which have to be accessed using https.

How do you know it is working correctly? When you do an R CMD check on your package you should get something which looks like

Suggests or Enhances not in mainstream repositories:
Availability using Additional_repositories specification:
dggrids yes