Skip to content
Prev 2446 / 12125 Next

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

Am Sonntag, 25. Februar 2018, 09:49:13 CET schrieb Marius Hofert:
'Additional_repositories' is meant for R package repositories, it won't work 
with source code git repos. if a package is in 'Suggests' and can't be found 
on CRAN or BioC, the additional repos given here are searched for it, but only 
for it's availability. it won't be installed, CRAN only checks whether it 
*could* be installed.

instead of throwing an error, i would probably fallback to a meaningful 
default at the beginning of the function code and warn the user about it:

  if(pkg == "loon" && !requireNamespace("loon", quietly = TRUE)) {
    pkg == "<no bar>"
    warning(paste(
     "Package 'loon' is unavailable, falling back to the default:", pkg
    ))
  } else {}

i'm dealing with a similar problem at the moment, the main diffenrence being 
that i brought it onto myself by outsourcing specific parts (support for 
several natural languages) of one huge package into several add-on packages, 
and these add-on packages were rejected from CRAN so i can't make any of them 
a dependecy. meaning they're not even archived :-D


viele gr??e :: m.eik