[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 15:56:40 CEST 2019
Dear Dirk,
> On Oct 3, 2019, at 9:11 AM, Dirk Eddelbuettel <edd using debian.org> wrote:
>
>
> Charles,
>
> 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?
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.
Best,
John
>
> - CRAN and R have a perfectly working dependency system [1] so just use
> 'Suggests: tinytex' and _then please condition your code on whether it is
> present_. [2]
>
> - Maybe add line breaks to your post? ;-)
>
> Dirk
>
> [1] I continue to argue, as recently as yesterday in private mail with a
> junior dev, that people misuse / misunderstand Depends and Suggests.
> [2] Because if you don't your Suggests: really is a Depends:.
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org
>
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
More information about the R-package-devel
mailing list