Re: [Rd] R package dependency issues when namespace is not attached

From: Jeroen Ooms <jeroen.ooms_at_stat.ucla.edu>
Date: Sun, 13 May 2012 13:53:49 -0700

On Sun, May 13, 2012 at 1:06 PM, Martin Morgan <mtmorgan_at_fhcrc.org> wrote:
> On 05/13/2012 12:14 PM, Jeroen Ooms wrote:
> As a package developer, I want to have the code my package sees be exactly
> what is needed, and no more.

Exactly. That is why you probably don't use Depends, but Imports in combination with a NAMESPACE file. Which is great, and we should encourage that practice. But as long as 'Depends' is also supported, this should be working properly as well.

Here a quote from
http://cran.r-project.org/doc/contrib/Leisch-CreatingPackages.pdf: "A stronger form of dependency can be specified in the optional Depends field listing packages which are necessary to run our code."

It think it seems reasonable to assume that when a package author decides to use 'Depends' (for whatever reason), they want the namespace to be available to their package. Hence I think R should import the full namespace of packages in the Depends field. I don't think this will generate too much overhead, because in most circumstances, the package will be loaded and attached anyway. Furthermore this will not slow down or affect packages that use the better practice of specifying 'Imports' instead of 'Depends' and explicitly import only required symbols.



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sun 13 May 2012 - 21:00:18 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 14 May 2012 - 11:21:21 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive