Skip to content
Prev 46684 / 63424 Next

Importing packages in Depend

On Thu, Sep 12, 2013 at 6:49 AM, Benjamin Hofner <benjamin.hofner at fau.de> wrote:
This happens because 'lme4' re-exports the generic function VarCorr()
that 'nlme' already exports.  R considers this to be a conflict and
generates a warnings, which is detected by 'R CMD check'.   I've been
trying to argue that this warning is unnecessary/not correct because
in these cases, the two objects in conflict are actually the same
identical object.  You can see this by:
function (x, sigma = 1, rdig = 3)
UseMethod("VarCorr")
<bytecode: 0x00000000111eb728>
<environment: namespace:nlme>
function (x, sigma = 1, rdig = 3)
UseMethod("VarCorr")
<bytecode: 0x00000000111eb728>
<environment: namespace:nlme>

Note how they are both in the same namespace, i.e.
[1] TRUE


I've submitted a patch for this 'Bug 15451 - PATCH:
namespaceImportFrom() not to warn when the identical object is
imported twice' on 2013-09-10
[https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15451].  The
tricky part is to convince R-core.

Otherwise, the only solution I know of is either to use importFrom():s
or to convince the author of 'lme4' to remove that re-export, which
may not be possible.

/Henrik