From jeroen.ooms at stat.ucla.edu  Sun May 13 22:53:49 2012
From: jeroen.ooms at stat.ucla.edu (Jeroen Ooms)
Date: Sun, 13 May 2012 13:53:49 -0700
Subject: [Rd] R package dependency issues when namespace is not attached
In-Reply-To: <4FB01438.9030907@fhcrc.org>
References: <CABFfbXuLstmkNWg3gG3cJmo=Kw33+B=8EoXK9kE9D82HA9oBLg@mail.gmail.com>
	<4FAF77DC.4040801@gmail.com>
	<4FAFEBE4.5020403@statistik.tu-dortmund.de>
	<CABFfbXt-LnGONFUSxqCWEi6Rkz1Yp62=ao=RN-n_pgJ-xWEpNA@mail.gmail.com>
	<4FB01438.9030907@fhcrc.org>
Message-ID: <CABFfbXsBgV4-qpFDOkT9nK5z=EKa2P+S+2aqX93Vwf=OcCO8Jg@mail.gmail.com>

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.



[Rd] R package dependency issues when namespace is not attached
Jeroen Ooms