Skip to content
Prev 316830 / 398506 Next

developing package: dealing with namespaces

On 04/02/2013 12:59 PM, Ross Boylan wrote:
I think the best workflow is to do the edits outside of R, and 
re-install the package to test.

It is possible to do edits to a loaded package, using the 
assignInNamespace() function, but I don't think there's a simple 
workflow that doesn't end up with multiple copies of functions, and 
possible confusion over which version
   - is in the source, so will be saved
   - is in the global env, so will be executed by a user at the top level
   - is in the namespace, so will be executed by calls from other 
functions in the namespace.

This is something that could probably be handled well by a smart 
editor.  I don't know if any of the existing IDEs do it.

Duncan Murdoch