[R-pkg-devel] Handling Not-Always-Needed Dependencies?

Dirk Eddelbuettel edd at debian.org
Tue Aug 2 19:01:12 CEST 2016


On 2 August 2016 at 11:36, Joshua Ulrich wrote:
| Maybe I'm missing something, but isn't that the point of calling
| requireNamespace()?  For example:
| if (requireNamespace("suggestedPackage"))
|   stop("suggestedPackage required but not installed")
| 
| That doesn't seem like a heavy burden for package writers when writing
| infrequently used functions in their package.  You could even add the
| install.packages command to the error message to instruct users to
| install the required package.

[...]

| I personally would not want install.packages() to install packages I'm
| unlikely to actually use.
| 
| It's also not clear to me how importing rarely used functions causes
| bloat, but installing all packages for all rarely-used functions does
| not cause bloat.

Sadly, some people whose advocacy is taken as religous gospel in some
circles, particularly beginners, advocate pretty much that: treat Suggests:
as Depends: and install it anyway because, hell, why would one tests.

I regularly run (large) reverse depends checks against some of my more widely
used packages and run into this all the time.

We (as a community, including CRAN whose gatekeepers I have failed to
convince about this on on multiple attempts) are doing this wrong.
"Suggests:" really means optionally, rather than unconditionally.  But it
would appear that you and I are about to only ones desiring that behaviour.

Dirk

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



More information about the R-package-devel mailing list