Skip to content
Prev 886 / 12125 Next

[R-pkg-devel] Force namespace prefix for a loaded package function

http://www.keittlab.org/
On Mon, Jun 27, 2016 at 3:22 AM, Joris Meys <jorismeys at gmail.com> wrote:

            
I think you missed the point (and stated the obvious).

A well-designed namespace feature would give control of imports to the code
user, not the code writer.

Right now, I have to avoid all the function names in base because I will
cause a collision. If I want to have an "options" function in my package, I
have to make it "pkgname_options" rather than pkgname::options, which is
greatly preferable and would allow the user to decide whether they want to
import it and then simply use "options" and "base::options".

I've always considered this all-or-nothing approach to imports a bug in the
implementation of namespaces in R. I was trying to suggest that it be
fixed. (Probably should have sent this to r-devel actually.)

THK