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

Fox, John j|ox @end|ng |rom mcm@@ter@c@
Thu Oct 3 17:26:56 CEST 2019


Hi Dirk,

> On Oct 3, 2019, at 10:20 AM, Dirk Eddelbuettel <edd using debian.org> wrote:
> 
> 
> 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". 

Yes, I noticed that, but didn't want people to be potentially misled since you didn't "RC"  ;)

> 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?

As it turns out, a lot, but I'm sure vastly fewer than you. The car package, e.g., has many reverse dependencies that I check before a new version of the package goes to CRAN.

> How often
> would you have wanted an interactive prompt?  

Well, never of course, but shouldn't interactive prompts only appear in interactive sessions -- e.g., enclosed in if (interactive()) {} in an example?

Moreover, I wasn't trying to argue that one *should* necessarily do this, just point out that one can in certain circumstances without violating CRAN policies. In the original context of this thread, a simple error message indicating that LaTeX is absent probably would suffice.

Best,
 John

> 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