Skip to content

[R-pkg-devel] extending a few functions from another package

2 messages · Facundo Muñoz, Mark van der Loo

#
Dear list,

I have built a package geoRcb (https://github.com/famuvie/geoRcb) which
is an extension of package geoR.
It provides some very specific additional functionality, in the form of
new arguments for only 3 functions from geoR.
It also has some original complementary functions, but otherwise keeps
most of geoR untouched.

To avoid forking the whole geoR package (and duplicating the vast
majority of the code), I only packaged the modified (or original)
functions. However, since these functions make use of some other
internal functions, I used the dirty trick of *implanting* the modified
functions within the geoR namespace
(https://github.com/famuvie/geoRcb/blob/master/R/geoRcb.R)

I understand that modifying another package's namespace is very bad.
But I don't see how to proceed correctly in this case without forking
the whole package.

Thanks for your suggestions.
        ?acu.-
#
Implanting is indeed a dirty trick. You could contact the maintainers of
geoR and ask if your code can be added to the package. Or perhaps they can
export some of the functionality you need.

/M







Op vr 28 aug. 2015 om 16:58 schreef Facundo Mu?oz <famuvie at gmail.com>: