Bug 17173 - enhancement to R CMD check: do imported objects from multiple packages mask each other?
Summary: enhancement to R CMD check: do imported objects from multiple packages mask e...
Alias: None
Product: R
Classification: Unclassified
Component: Wishlist (show other bugs)
Version: R 3.3.0
Hardware: All All
: P5 enhancement
Assignee: R-core
Depends on:
Reported: 2016-10-27 12:56 UTC by Steffen Wagner
Modified: 2016-10-27 18:34 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Wagner 2016-10-27 12:56:42 UTC
Dear R-Developement Team,

I want to suggest an additiol check to the R CMD check functionality.

Consider the situation where the objects of more than one package are
imported to the NAMESPACE of a third package, e.g. via

   import(foo, bar)

in the NAMESPACE file.

There might be situations where exported objects in the packages `foo`
and `bar` have the same name, let´s say there is an object `f`
exported from both packages.

Then a warning created by R CMD check comparable to the same situation
when attaching multiple packages to the search path, like

> library(foo)
> library(bar)
The following objects are masked from ‘package:foo’:

would be very helpful.

I am aware that it is not best practice to import many packages with
many exported objects to the NAMESPACE of another package.
Nevertheless it would be nice feature to be warned about the resulting
name conflict.
Comment 1 Michael Lawrence 2016-10-27 16:20:59 UTC
If memory serves, there is already a message emitted during installation about replacing a previous import. This could be elevated to a level such that it is reported by R CMD check. Not sure it's severe enough to be a warning though. Maybe just a note.
Comment 2 Duncan Murdoch 2016-10-27 18:34:34 UTC
I'd say it's serious enough to be a warning.  Package authors can always 
do their imports explicitly and avoid it.  If one of their dependencies adds a new function that collides with another dependency, that can cause the package to break.