[Bioc-devel] Why can't NAMESPACE be a strict subset of DESCRIPTION Imports?

Dan Tenenbaum dtenenba at fredhutch.org
Tue Oct 4 23:13:43 CEST 2016



----- Original Message -----
> From: "Martin Morgan" <martin.morgan at roswellpark.org>
> To: "McDavid, Andrew" <Andrew_Mcdavid at urmc.rochester.edu>, "bioc-devel" <bioc-devel at r-project.org>
> Sent: Tuesday, October 4, 2016 2:09:27 PM
> Subject: Re: [Bioc-devel] Why can't NAMESPACE be a strict subset of DESCRIPTION Imports?

> On 10/04/2016 05:07 PM, McDavid, Andrew wrote:
>> BiocCheck throws a warning when a package is listed as Imports: in DESCRIPTION
>> but not used in the NAMESPACE.  This may happen when a developer uses the fully
>> qualified names of objects within a package.  I am unclear as to the rationale
>> for this warning.
>>
> 
> agree it's wrong. can you point to an example? Martin
> 

https://bioconductor.org/spb_reports/MAST_buildreport_20160929192258.html#zin1_check_anchor

* Checking DESCRIPTION/NAMESPACE consistency...
    * WARNING: Import parallel, reshape2 in NAMESPACE as well as
      DESCRIPTION.

Dan



>> Per Hadley:
>>
>> It's common for packages to be listed in Imports in DESCRIPTION, but not in
>> NAMESPACE. In fact, this is what I recommend: list the package in DESCRIPTION
>> so that it's installed, then always refer to it explicitly with pkg::fun().
>> Unless there is a strong reason not to, it's better to be explicit. It's a
>> little more work to write, but a lot easier to read when you come back to the
>> code in the future.
>>
>> Per R extensions:
>>
>> If a package only needs a few objects from another package it can use a fully
>> qualified variable reference in the code instead of a formal import. A fully
>> qualified reference to the function f in package foo is of the form foo::f.
>>
>> -Andrew
>>
>>
>> 	[[alternative HTML version deleted]]
>>
>> _______________________________________________
>> Bioc-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>>
> 
> 
> This email message may contain legally privileged and/or...{{dropped:2}}
> 
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel



More information about the Bioc-devel mailing list