From pgilbert902 at gmail.com  Sun Dec  8 05:15:49 2013
From: pgilbert902 at gmail.com (Paul Gilbert)
Date: Sat, 07 Dec 2013 23:15:49 -0500
Subject: [Rd] Depending/Importing data only packages
In-Reply-To: <CABdHhvEGMmJszw0pY6xpddWPapGeY9yqRbA7k2JVLkKVcqiD2Q@mail.gmail.com>
References: <CABdHhvEXM_Bbr7GXP0nRiURCGfVzcFXOi--9sLUiBe3YrdP-qQ@mail.gmail.com>
	<52A35220.7010307@gmail.com>
	<CABtg=K=pVVZzRxj5JtLuP92kL1Fiho3gxC85HJouV6ZHjeikDw@mail.gmail.com>
	<52A36A75.5030900@gmail.com>
	<CAP01uRnaiEP5Es8=eTxu8Y2ZuiE+gvND72zbm4Q67FR-R-jQPQ@mail.gmail.com>
	<52A39C4A.8000305@gmail.com>
	<CADwqtCN_Hx6pbUrjFZoNgTazJ5hH9SoB=h=E3+6rC+u0jr5a1Q@mail.gmail.com>
	<CABdHhvEGMmJszw0pY6xpddWPapGeY9yqRbA7k2JVLkKVcqiD2Q@mail.gmail.com>
Message-ID: <52A3F275.8000804@gmail.com>



On 13-12-07 05:21 PM, Hadley Wickham wrote:
>> The Writing R Extensions manual says that Suggests is for packages which
>> are required only for examples, which I believe matches Hadley's original
>> question.
>
> Yes, but without this package they won't be able to run the majority
> of examples, which I think delivers a poor experience to the user. It
> also means I have to litter my examples with if(require("x")),

I think you just need require("x") or library("x"). If it is in Suggests 
then it is available whenever examples are tested, so you don't need the 
if(). In my opinion, this increases the signal by indicating to the 
reader where the data comes from.

> decreasing the signal to noise ratio in the examples.
>
> But we're getting a bit far from my original question about the NOTE:
>
>    Package in Depends field not imported from: 'hflights'
>    These packages needs to imported from for the case when
>    this namespace is loaded but not attached.
>
> Depending on (or linking to) a package is not just about making the
> functions in the package available.

Several of us used to think that, but the modern interpretation seems to 
be just about making things in the package yours depends on available to 
users of your package. "Exports:" might be a better term than 
"Depends:", at least if Depends: was not trying to mean both Imports: 
and Exports:".

Paul
>
> Hadley
>



[Rd] Depending/Importing data only packages
Paul Gilbert