Skip to content
Prev 17260 / 63424 Next

Functions with the same name: best practices

It depends on the example, as you might guess.

profile() is a generic function in stats.  Namespaces are not going to 
help there, as it is normally called by users (it is also called by some 
confint() methods, and that will be protected by namespaces).

For functions intended to be used by end-users, I think there is little 
choice but to have distinct names.  For other functions, you would not 
need to export them from the namespace of your package, and then probably 
the nameclash would be of little consequence.  However, even there beware 
of examples like Adai's with 'df', where model.frame() found that object 
in the package rather than in his workspace.
On Mon, 22 Aug 2005, hadley wickham wrote: