[ESS] Developing R packages under ESS
Richard M. Heiberger
rmh @end|ng |rom temp|e@edu
Thu Mar 8 02:52:39 CET 2018
normally, it just works. Do you have a recent ESS? Try turning off
your .emacs and see if that helps.
When you open .R files from a package, ESS knows about the package.
When you C-c C-c revised files
they go into the package namespace.
On Wed, Mar 7, 2018 at 8:28 PM, Boylan, Ross <Ross.Boylan using ucsf.edu> wrote:
> Can anyone suggest to me a good way to develop R packages with ESS? "good" here means that I can debug the code and make changes to the code without rebuilding the whole package.
> So far I've tried a bunch of different approaches, but none has quite worked.
> 1. When I had an old (or even new) version of the package in the standard load paths I tended to get "namespace is locked" errors when I modified the code and attempted to read it in. So I deleted the installation in the standard path.
> 2. Wrote a script that sourced all the .R files. But when I change them and reload in ESS I get the error "unable to load <mylibrary>", even if I do C-c C-t C-s to turn off the namespace. I suspected the problem might have been from evaluating vignette code in an .rnw file, but even if I copied and pasted it into the the main *R* buffer I still get the problem:
> Loading required package: LazarSim
> Error in .requirePackage(package) (from SimParameters.R#35) :
> unable to find required package ‘LazarSim’
> In addition: Warning message:
> In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
> there is no package called ‘LazarSim’
> BTW, that error happened after I attempted to execute some code from the package, not when I issued any load/library/require type command.
> R is running in the directory above the package directory.
> Grep confirms my recollection that I don't have code that does require().
> Maybe R overrides the basic code for sourcing files? My test file uses source() to load the source files, which are in the package directory.
> Thanks for any help.
> ESS-help using r-project.org mailing list
More information about the ESS-help