[Rd] Developer work cycle

Hin-Tak Leung hin-tak.leung at cimr.cam.ac.uk
Mon Mar 26 20:38:05 CEST 2007

José Luis Aznarte M. wrote:
> Hin-Tak Leung wrote:
>> I don't do 2, 3, 4 that way. I just run the sessions in parallel,
>> and do (no root privilege required):
>> R CMD INSTALL -l sometemplace mypackage
>> and in a parallel session, do
>> library(mypackage, lib.loc="sometemplate")
>     What do you mean by "sometemplate"? Is that the complete path to
> where the library's source is? Or is it a temporary folder to install
> it? In that case, I could use /tmp/ (in linux) to install test versions
> of the library? And, by doing the "library(mypackage, lib.log="/tmp")"
> call, do I overwrite the current one, including namespaces and so on?
>     Sorry I did not understand exactly what you meant. Thank you so much
> anyway. :-)

typo... happier with this below? Both of them (same "/tmp") is
an alternative installed location, not source location.

R CMD INSTALL -l /tmp mypackage

library(mypackage, lib.loc="/tmp")

I don't think you can do 'library(mypackage, lib.loc="/tmp")' twice
(with a re-install in the middle), if that's what you are thinking.
I think you need to do detach(package:mypackage) at least,
and even then, windows's dll loader gets very confused. I believe
I had managed to crash R by dyn.load()'ing two object files of the
same name twice under wine, so I am not sure it is a good idea.

I read somewhere that object files are never unloaded, but you'll need 
to hear it from the R experts...


More information about the R-devel mailing list