[R] question about tool collisions

Carl Witthoft carl at witthoft.com
Sat Feb 14 01:05:22 CET 2009


Recently I got introduced to two packages:  {seewave}  and {audio} . 
Turns out they both have a tool to call a system audio tool, and in both 
cases the name of the tool is play().   Naturally these two tools do 
slightly different things with different arguments.

So, what should a user do, and more to the point, what should R do?  If 
I've learned the right things about environments, I could include some 
require() statements inside scripts to guarantee the right things are 
loaded (and only loaded for that script).
But in general when there are two commands with the same name, it means 
that if I distribute code which uses the command, a random user 
elsewhere might have the other package loaded and bad things would happen.


In a perfect world, there would be some R control database that people 
would check packages into.  The database (or some poor volunteer) would 
verify there were no naming conflicts with other posted packages, and so 
on.  Failing that,  what are good rules for fail-safing code, or 
figuring out how to check that some package I've loaded didn't blow away 
some other tools I previously loaded?


Carl




More information about the R-help mailing list