What to do re 'replacing previous import' errors

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

What to do re 'replacing previous import' errors

Ronald Barry
After looking at a few discussions of this problem online, I can't seem to
find a good solution.  When running a CHECK on a package I'm working on
(which passed all tests a few years ago), I get the following 'significant
warning':

Warning: replacing previous import ‘spam::tail’ by ‘utils::tail’ when
loading ‘latticeDensity’
  Warning: replacing previous import ‘spam::head’ by ‘utils::head’ when
loading ‘latticeDensity’

Humorously enough, I don't use the 'tail' function anywhere.  It seems to
be some sort of namespace clash between spam and utils.  In my namespace,
I'm importing spam and utils.  Is there a fix for this problem?  Thanks.

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: What to do re 'replacing previous import' errors

Duncan Murdoch-2
On 20/05/2017 5:14 AM, Ronald Barry wrote:

> After looking at a few discussions of this problem online, I can't seem to
> find a good solution.  When running a CHECK on a package I'm working on
> (which passed all tests a few years ago), I get the following 'significant
> warning':
>
> Warning: replacing previous import ‘spam::tail’ by ‘utils::tail’ when
> loading ‘latticeDensity’
>   Warning: replacing previous import ‘spam::head’ by ‘utils::head’ when
> loading ‘latticeDensity’
>
> Humorously enough, I don't use the 'tail' function anywhere.  It seems to
> be some sort of namespace clash between spam and utils.  In my namespace,
> I'm importing spam and utils.  Is there a fix for this problem?  Thanks.

It's generally a good idea to import only the functions you need, not
everything. If latticeDensity used

importFrom(utils, foo, bar)

etc., then it would only get a clash if you explicitly imported two
things with the same name.  (You can do a rename when importing if you
really want to do that.)

Duncan Murdoch

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Loading...