Skip to content

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

4 messages · Marius Hofert, Duncan Murdoch, Dirk Eddelbuettel +1 more

#
On Sun, Feb 25, 2018 at 1:09 AM, Dirk Eddelbuettel <edd at debian.org> wrote:
Hi Dirk,

nice to hear from you and thanks for helping!

Yes, 'foo' essentially has one main function with an argument 'method
= c("b", "ba", "bar")'. If the user chooses to call the function with
method = "bar", then it is checked whether "bar" is installed (as
described in WRE) and an error is thrown if not.
The full story is this: 'bar' has been archived because 'problems were
not corrected despite reminders'. 'bar' is mainly developed on github
and is probably easy to fix, but I also couldn't reach the maintainer
and I thought it's better to 'decrease' the dependency on 'bar' as
much as possible. 'bar' is actually quite intrusive to install/use
(requires R to be configured with tcltk). However, 'bar' provides some
nice features which the other methods ("b", "ba") don't have -- would
be a pity to completely remove 'bar' from 'foo'.

So 'bar' is on github (and thus could be installed from there + 'foo'
could make use of 'bar' conditionally... just don't know how to submit
'foo' to CRAN because of the warning)

Cheers,
M
#
On 24/02/2018 7:26 PM, Marius Hofert wrote:
Don't throw an error, work around it.  If you have no alternative code, 
then don't test the "bar" code unless "bar" is installed.

The basic idea is that your package should pass tests without errors 
even if "bar" is not available.

I think Dirk is wrong saying that "bar" has to be available; CRAN isn't 
going to go looking for it.  But they do want your package to pass all 
tests even if none of the Suggests packages is available.

Duncan Murdoch
#
On 24 February 2018 at 19:41, Duncan Murdoch wrote:
| Don't throw an error, work around it.  If you have no alternative code, 
| then don't test the "bar" code unless "bar" is installed.
| 
| The basic idea is that your package should pass tests without errors 
| even if "bar" is not available.

100% agreed.
 
| I think Dirk is wrong saying that "bar" has to be available; CRAN isn't 
| going to go looking for it.  But they do want your package to pass all 
| tests even if none of the Suggests packages is available.

I might be wrong but I thought all package in Imports, LinkingTo, Depends and
Suggests are actually checked for availability.

CRAN and BioC work by default, others can be added via Additional_repository
in DESCRIPTION.  And as I recall, not mentioning one leads to some complaint
from R CMD check. But I may well misremember.

Best, Dirk
#
The relevant part of the repository policy:
My understanding is that "should be available" means "if it's not
available, expect a NOTE (at least) and you should address this note
in your submission". Also, I think "available" means "available and
installable".

For example, I get a NOTE for 'taxstats', a suggested package of
grattan that isn't on CRAN:

* checking CRAN incoming feasibility ... NOTE
Suggests or Enhances not in mainstream repositories:
taxstats
Availability using Additional_repositories specification:
taxstats yes https://hughparsonage.github.io/drat/


However, the reason taxstats is not on CRAN is because it's too big,
not because it's unable to be installed or has other problems. At the
time it was archived, package loon could only be installed on OSX as
far as I can see, which may disqualify it from even being suggested.
My understanding is that CRAN does indeed check the package with
non-mainstream packages installed (at least on initial submission).
You may be better off just hoisting the functions you need outside of
loon (with attribution and while respecting the licence) if you really
need them.

(You say that package loon's problems are easy to fix. You may be able
to accede to be its maintainer but I don't know the details of this
process. The CRAN repository policy contemplates this when the package
is orphaned, but I'm not sure if it's the same process when the
package is archived.)
On 25 February 2018 at 11:59, Dirk Eddelbuettel <edd at debian.org> wrote: