[R-pkg-devel] Appropriate usage of 'Suggests' -- package installed conditional on other software not found

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Thu Oct 3 16:20:40 CEST 2019


Hi John,

On 3 October 2019 at 13:56, Fox, John wrote:
| > On Oct 3, 2019, at 9:11 AM, Dirk Eddelbuettel <edd using debian.org> wrote:
| > On 3 October 2019 at 10:10, Driver, Charles wrote:
| > | I have a function that outputs / compiles some latex. To do this I use Sys.which('pdflatex') and if nothing is found, prompt the user whether to install tinytex package. So, normally I understand the use of 'Suggests' in the package description to be for when there are only certain functions / tests that require the package. In this case, the package requirement is also conditional on other software (ie a tex distribution) not being found, otherwise it is unnecessary. There are no tests or examples that depend on the package. Should tinytex be in the 'Suggests' list?
| > 
| > A few suggestions:
| > 
| > - IIRC CRAN Policy asks you to not have interactive prompts, and clearly
| >   prohibits messing with the system.  So no to the prompt to install.
| 
| Can you point to where in the CRAN policies this behaviour is prohibited?

Well I hedged my bet with "IIRC". Interactive prompts are neither explicitly
allowed, nor disallowed, but the larger paragraph you quote from gives some
hints.  Now, turning from the 'letter of the law' to the 'spirit of the law',
how many packages have you checked in the 25+ years of using R? How often
would you have wanted an interactive prompt?  I just ran reverse depends for
both Rcpp and RcppArmadillo in the last 48 hours so that is 2000+ packages --
and I am rather glad I didn't face prompts for any one of those 2000+.

| The closest I can see is: "Packages should not write in the user’s home filespace (including clipboards), nor anywhere else on the file system apart from the R session’s temporary directory ... " But then, "Limited exceptions may be allowed in interactive sessions if the package obtains confirmation from the user."
| 
| Moreover, the tinytex package does precisely these kinds of things, including installing LaTeX.

And tinytex is something I keep finding problematic as it creates an
obfuscation layer. There was a recent (purely latex-side) bug I fixed in one
of my packages after an alert from CRAN.  But the additional tinytex layer
made the latex-side error incomprehensible to misleading to the point where
the CRAN maintainer was mislead (as I was later).  Running plain tex is
better. I so wish tinytex would let me opt out and render directly via
tools::texi2pdf but sadly I have no such option.  I understand that tinytex
seems to help on some platforms without working infrastruture; I have always
had working (and extensible) texlive around due to the OS/distro I use.

Anyway, this is going off-topic.  It might be nice for R to offer a query
whether 'is tex available?' just how capabilities() and extSoftVersion()
gives hint on some other optional capabilities (which are arguably closer to
its core).

Dirk

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



More information about the R-package-devel mailing list