From sfalcon at fhcrc.org  Fri May  5 16:56:02 2006
From: sfalcon at fhcrc.org (Seth Falcon)
Date: Fri, 05 May 2006 07:56:02 -0700
Subject: [Rd] Including a single function from a package
In-Reply-To: <Pine.LNX.4.64.0605051509060.3432@gannet.stats.ox.ac.uk> (Brian
	Ripley's message of "Fri, 5 May 2006 15:12:05 +0100 (BST)")
References: <445B4845.6010804@Indiana.Edu>
	<Pine.LNX.4.64.0605051350530.613@gannet.stats.ox.ac.uk>
	<445B5AED.7090108@Indiana.Edu>
	<Pine.LNX.4.64.0605051509060.3432@gannet.stats.ox.ac.uk>
Message-ID: <m23bfoed19.fsf@ziti.local>

Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:

> On Fri, 5 May 2006, Ken Kelley wrote:
>
>> Thank you both very much for your quick and helpful responses.
>>
>> I added "Imports: MASS, gsl" to the DESCRIPTION file and that took care of 
>> loading in the desired functions just fine. I went back and took another look 
>> at the "Specifying imports and exports" section (section 1.6.1) of the 
>> Writing R Extensions manual and I do not see anything about including an 
>> "Imports:" line in the DESCRIPTION file when including an "importFrom" in the 
>> NAMESPACE file. Perhaps including this information in a future update should 
>> be considered.
>
> Well, no, it described under the DESCRIPTION file:
>
>    The optional @samp{Imports} field lists packages whose namespaces are
>    imported from but which do not need to be attached.
>
> Note that caveat which complicates the issue and I think makes in 
> inappropriate for that section.

I think it would be an improvement to mention in the namespace
documentation that imported package must appear in either Depends or
Imports in the DESCRIPTION file as well as being mentioned in the
NAMESPACE file.  The requirment that this information be repeated is
not obvious to many.  That is, one might reasonably imagine that
specifying imports with an importsFrom directive in the NAMESPACE file
is enough.

+ seth



[Rd] Including a single function from a package
Seth Falcon