[R-pkg-devel] Additional_packages in drat repositories

Sokol Serguei @ergue|@@oko| @end|ng |rom gm@||@com
Thu Nov 9 10:30:08 CET 2023


Le 09/11/2023 à 08:01, Claborne, Daniel via R-package-devel a écrit :
> I have a data package �pmartRdata� hosted in a drat repository here:  https://github.com/pmartR/drat following the instructions here:  https://cran.r-project.org/web/packages/drat/vignettes/DratStepByStep.html
>
> The package installs fine via install.packages(�pmartRdata�, repos = �https://pmartR.github.io/drat�).  I have included it under Suggests and added �https://pmartR.github.io/drat� to the Additional_repositories field in the DESCRIPTION of a package I am submitting to CRAN.  I�m getting failures on Debian/R-devel and Windows/R-devel when running examples that use this package:
>
> `Error in library(pmartRdata) : there is no package called �pmartRdata�`
>
> Checks on rhub via `rhub::check_for_cran` for ubuntu,fedora, and windows do not have this problem.  What do I need to do to get it to install on CRAN submission machines?

Generally, you cannot assume that suggested package is available on CRAN 
(or any other) machine. Instead, you have to put the code involving 
suggested package inside an 'if()' clause, like:

if (requireNamespace("pkg", quietly=TRUE) {

    pkg::do_something()

}


Best,
Serguei.


>
> Best,
> -Daniel Claborne
>
> 	[[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel



More information about the R-package-devel mailing list