[R-pkg-devel] [FORGED] Re: How to (conditionally) use an archived package (without Suggests)?

Dirk Eddelbuettel edd at debian.org
Sun Feb 25 13:26:10 CET 2018

On 25 February 2018 at 11:50, Marius Hofert wrote:
| perfectly works (even if you don't have loon) *except* for the check
| (--as-cran) to give me the warning:
| * checking dependencies in R code ... WARNING
| '::' or ':::' import not declared from: ‘loon’
| 'loadNamespace' or 'requireNamespace' call not declared from: ‘loon’
| ... and putting 'loon' in Suggests (to avoid this warning) does not
| seem to be allowed as 'loon' is not on CRAN.

As already suggested:
 - create a drat repository,
 - place a copy of loon (from its repo source or the Archive section) in it
 - add the repo to Additional_repositories
 - using Suggests: is now permissible as the package is now useable
 - the ':::' not declared warning should now go away.

To recap: 'R CMD check --as-cran' sees your package use external code you
have not declared a source for, so you get a warning. The only way to get rid
of the warning is to declare the code dependency, and for optional code you
can use Suggests, which can also use Additional_repositories so you can
reintroduce (in a repo you setup and manage) a package CRAN no longer has.

An 'archived' package no longer exists in the package dependency graph
("Archive" is not a repo) so you need to create one. Here Suggests: and
Additional_repositories play along together nicely; drat helps create and
manage a simple repo you can use.


http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org

More information about the R-package-devel mailing list