[Rd] Editing a package with a NAMESPACE in place

Seth Falcon sfalcon at fhcrc.org
Tue Jun 6 16:31:22 CEST 2006


Sean Davis <sdavis2 at mail.nih.gov> writes:

> On 6/6/06 8:33 AM, "Uwe Ligges" <ligges at statistik.uni-dortmund.de> wrote:
>
>> See ?assignInNamespace and ?fixInNamespace
>
> Thanks, Uwe.  I should have been able to find those, but....
>
>> During developing, I suggest to remove the NAMESPACE temporarily.
>
> I wondered if that was common practice.

For simple packages, removing the NAMESPACE file will work well and is
certainly very convenient.  However, with more complex packages (in
terms of dependencies and S4 stuff) it may not work so well:

* You won't be testing the _real_ package (this is a problem
  regardless of complexity I suppose).

* Without the NAMESPACE, you may get the wrong functions and see all
  sorts of breakage.  IOW, some packages rely on the NAMESPACE to
  function properly; removing it does more than just exposing private
  functions.

In practice I tend not to follow my advice :-/.  What I often do is
the equivalent of source() on the required .R files while I'm fixing a
particular function or method.  But I do make sure to go through an
INSTALL/test cycle (with NAMESPACE) frequently.

Cheers,

+ seth



More information about the R-devel mailing list