Skip to content
Back to formatted view

Raw Message

Message-ID: <1475615218404.94056@URMC.Rochester.edu>
Date: 2016-10-04T21:07:00Z
From: McDavid, Andrew
Subject: [Bioc-devel] Why can't NAMESPACE be a strict subset of DESCRIPTION Imports?

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.

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]]