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

meik michalke meik.michalke at hhu.de
Sun Feb 25 11:51:16 CET 2018


Am Sonntag, 25. Februar 2018, 09:49:13 CET schrieb Marius Hofert:
> * checking CRAN incoming feasibility ...Warning: unable to access
> index for repository https://github.com/waddella/loon/src/contrib:
>   cannot open URL 'https://github.com/waddella/loon/src/contrib/PACKAGES'

'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

-- 
  dipl. psych. meik michalke
  abt. f"ur diagnostik und differentielle psychologie
  institut f"ur experimentelle psychologie
  heinrich-heine-universit"at                             
  geb"aude 23.03.00.26        |  tel +49 (0)211 8113498
  40204 d"usseldorf           |  fax +49 (0)211 8111753

  http://www.psycho.hhu.de    https://reaktanz.de
  https://rkward.kde.org      https://twitter.com/RKWardNet

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <https://stat.ethz.ch/pipermail/r-package-devel/attachments/20180225/aa82cf32/attachment.sig>


More information about the R-package-devel mailing list