I want to use the R package BOLTSSIRR
available on GitHub in my R package, which I want to upload to CRAN.
I listed BOLTSSIRR
under Suggests:
in the DESCRIPTION
file and made the link to GitHub available using Additional_repositories: https://github.com/daviddaigithub/BOLTSSIRR
.
However, running R CMD check --as-cran
I get:
Suggests or Enhances not in mainstream repositories:
BOLTSSIRR
Availability using Additional_repositories specification:
BOLTSSIRR no ?
? ? https://github.com/daviddaigithub/BOLTSSIRR
Additional repositories with no packages:
https://github.com/daviddaigithub/BOLTSSIRR
So the GitHub link does not seem to get recognized in the check. Might I have to change something here?
As you found, you can't use Remotes
in a CRAN package. What you need to do is to make sure the .tar.gz
file for the package you are depending on is available somewhere. Github doesn't do that automatically, because https://github.com/daviddaigithub/BOLTSSIRR
isn't set up as a package repository.
The solution is to create your own small repository, and keep copies of non-CRAN packages there. The drat
package (available here: https://github.com/eddelbuettel/drat) makes this easy as long as you have a Github account: follow the instructions here: https://github.com/drat-base/drat. In summary:
docs/
folder in the main branch.drat
package into R using remotes::install_github("eddelbuettel/drat")
. (I assume this version will make it to CRAN eventually; if you use the current CRAN version instructions are slightly more complicated.)options(dratBranch="docs"); drat::insertPackage(...)
to insert those files into your repository.Additional_repositories: https://yourname.github.io/drat
You will be responsible for updating your repository if BOLTSSIRR
is updated. This is good because the updates might break yours: after all, it's still in development mode. It's also bad because your users won't automatically get bug fixes.
That's it, if I haven't missed anything!