From mtmorgan at fhcrc.org  Thu Aug 28 15:05:05 2014
From: mtmorgan at fhcrc.org (Martin Morgan)
Date: Thu, 28 Aug 2014 06:05:05 -0700
Subject: [Rd] Re R CMD check checking in development version of R
In-Reply-To: <CABdHhvEvkLwekWtYxgeFo9fKE8dZHPUzaWV=SOLE9Aox5UNbTA@mail.gmail.com>
References: <CAAHES9xbHJLUbzLzS7C2tTaODv=d_JV5ds09ZFdA6Bv+uBSYEA@mail.gmail.com>
	<CABdHhvG7ahtFhBOCRU9X2KRR2Z30S1gE_F66m0W=91wpkbvyOA@mail.gmail.com>
	<CAAHES9yzPkidSVAW6=BE689mrfo7Bv_MHZ=WzanHwpctGC21Tg@mail.gmail.com>
	<CABdHhvEX3LWudrX-nFiUO1RcgJsYtYhcLOp0FFufHPw8yU1Kag@mail.gmail.com>
	<CAAHES9yXGVs+bzmSs-CEwA2DhGMmOr1cHT2PfkdKzodiP5G=Xw@mail.gmail.com>
	<53FF20BC.1060704@fhcrc.org>
	<CABdHhvEvkLwekWtYxgeFo9fKE8dZHPUzaWV=SOLE9Aox5UNbTA@mail.gmail.com>
Message-ID: <53FF2901.9060409@fhcrc.org>

On 08/28/2014 05:52 AM, Hadley Wickham wrote:
>>>> I'd say: Depends is a historical artefact from ye old days before
>>>> package namespaces. Apart from depending on a specific version of R,
>>>> you should basically never use depends.  (The one exception is, as
>>>> mentioned in R-exts, if you're writing something like latticeExtras
>>>> that doesn't make sense unless lattice is already loaded).
>>>
>>> Keeping this nuance in mind when when discussing Depends vs Imports is
>>> important so as to not suggest that there isn't any reason to use Depends
>>> any longer.
>>
>> A common case in Bioconductor is that a package defines a class and methods
>> intended for the user; this requires the package to be on the search path
>> (else the user wouldn't be able to do anything with the returned object). A
>> class and supporting methods can represent significant infrastructure, so
>> that it makes sense to separate these in distinct packages. It is not
>> uncommon to find 3-5 or more packages in the Depends: field of derived
>> packages for this reason.
>
> For that scenario, is it reasonable to say that every package in
> depends must also be in imports?

Important to pay attention to capitalization here. A package listed in Depends: 
_never_ needs to be listed in Imports:, but will often be import()'ed (in one 
way or another) in the NAMESPACE. Some would argue that listing a package in 
Depends: and Imports: in this case clarifies intent -- provides functionality 
available to the user, and important for the package itself. Others (such as R 
CMD check) view the replication as redundancy.

I think one can imagine scenarios where a package in the Depends: fields does 
not actually have anything import()'ed, e.g., PkgA defines a class, PkgB 
provides some special functionality that returns the class PkgC use PkgB's 
special functionality without ever manipulating the object of PkgA.

Martin Morgan

>
> Hadley
>


-- 
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793



[Rd] Re R CMD check checking in development version of R
Martin Morgan