[Rd] NAMESPACE

Duncan Murdoch murdoch at stats.uwo.ca
Fri Sep 22 20:29:53 CEST 2006


On 9/22/2006 2:07 PM, Dominick Samperi wrote:
> Hello,
> 
> I just tried to use NAMESPACE to prevent name conflicts between
> packages and it appears that once a name is exported it will clash
> with the same name if it is exported from another package, in
> particular, if that other package does not use NAMESPACE.
> 
> Is there a way to "export" a name so that the current package
> user can see it, but other packages cannot see it? My working
> assumption is that this is not possible, so I use a prefix like
> the package name to keep function names "local."

I don't think so.  Packages without namespaces start their search for 
names in the global environment, i.e. they see what a user sees.  This 
makes them very fragile, and there's not much you can do about that, 
other than encouraging the author to bite the bullet and install a 
namespace.

Duncan Murdoch




More information about the R-devel mailing list