[Rd] Including a single function from a package

Seth Falcon sfalcon at fhcrc.org
Fri May 5 16:56:02 CEST 2006


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



More information about the R-devel mailing list