[ESS] Usage of ESS developer together with devtools and load_all

Rainer M. Krug Rainer at krugs.de
Mon Jun 3 09:45:50 CEST 2013


Vitalie Spinu <spinuvit at gmail.com> writes:

> I was not aware of load_all. I was always using install() then
> library(), instead.
>
> It's a bit unfortunate that ess-developer-add-package hardcodes the
> library() call. I thought it should be always useful.
>
> I can add an option, but it looks to me like an ugly solution. Another
> idea would be to completely remove the call to library and rely on the
> user to load the library. 

Initially I thought that an option would be useful, but the complication is
that load_all() needs the path to the package files, which can be
completely different for different packages. One option would be to be
able to disable the call of library(), i.e. an option
load-library-on-developer which if true (the default) loads the package,
but if false does not load the package and leaves this to the
developer.

>
> BTW, if you issue library(asm) after load_all("packages/asm"), is old
> asm still loaded? If not then as an easy workaround you can use
> ess-developer-enter-source file to "load_all" your asm package.

Yes - that works. Thanks.
But it gives the impression in R, as if it would have loaded the
package, which irritated me at the beginning, until I checked the source
code of library(), which does check if the package is already
loaded. The option verbose=TRUE in the library call might be a good
default option here.

Thanks,

Rainer


>
>     Vitalie
>
>
>  >> "Rainer M. Krug" <Rainer at krugs.de>
>  >> on Fri, 31 May 2013 11:34:56 +0200 wrote:
>
>  > Sorry if this has been posted, but I could not find it.
>  > Hi
>
>  > I am using at the moment devtools and the function load_all() instead of
>  > library() to load the packages on which I am working on. Now I saw ESS
>  > developer and it looks like a very handy tool in package
>  > development. But I have one problem: when I add a package (say asm) to the
>  > development list, it gets loaded by a executing library(asm). But I am
>  > editing in the package directory of asm and have no package asm installed which can
>  > be loaded (actually, this is not true, but the version installed is old
>  > and I could actually delete it...). Is there any way that I can set the
>  > command executed in R to load_all("/packages/asm")? And this is where it
>  > gets tricky - the path.
>
>  > Any suggestions?
>
>  > Thanks,
>
>  > Rainer
<#secure method=pgpmime mode=sign>

-- 
Rainer M. Krug

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer at krugs.de

Skype:      RMkrug



More information about the ESS-help mailing list