How to make package R recommend a package hosted on GitHub?

I am developing an R package that works as a wrapper for functions from parallel packages and Rhpc packages called ctools . I know that if I want my package to require these packages, I need to include them in the Imports section of the DESCRIPTION file. When installing my package, these packages will be installed from CRAN. In the same way, I can put them in the Suggests section if they are not required, but useful. They will not be installed with my package.

But I forked the Rhpc package and added the function that I use in my ctools package. How can I get my package to offer / import this package from my GitHub repository, instead of installing the Rhpc package, it does devtools::install_github("bamonroe/Rhpc") ?

+5
source share
1 answer

From the manual (and citation source here):

@c Field DESCRIPTION Additional_repositories

The @samp field {Additional_repositories} is a comma-separated list of repository URLs where packages named in other fields can be found. @Command {R CMD check} is currently being used to verify that packages can be found, at least as source packages (which can be installed on any platform).

You can add the package to Suggests: and specify additional repositories - possibly created using drat . Once this was done with the package, and IIRC has another one doing it now, but now his name has slipped away.

Edit: found! See here in the DESCRIPTION source file of the RNeXML file - and note how the line disappears into the placed DESCRIPTION on the CRAN . Better yet, note that in the two packages in Suggests: there are no hyperlinks to CRAN. I think they come from additional repositories. And yes, rOpenSci uses drat to control this.

Edit 2: and just to close the loop, you (easily) use drat to host such an additional repo on GitHub - the main use case for drat .

+7
source

Source: https://habr.com/ru/post/1245387/


All Articles