[ESS] cannot add bindings to a locked environment

Boylan, Ross Ro@@@Boy|@n @end|ng |rom uc@|@edu
Mon Jul 25 20:42:18 CEST 2016


I've been able to recreate the problem in simpler form.
With NAMESPACE
import(methods, Matrix)

exportClasses(DataParameters)
export(DataParameters)
exportMethods(generate)

and a package with only a file definining DataParameters and generate I install the package.
Then I add the Test.R file with S4 class StandBonf and method shortName to the package source tree and read it in.  This loads the library, which includes neither StandBonf or shortName.

 > sb <- StandBonf(alpha=0.1)
 > class(sb)
 [1] "StandBonf"
 attr(,"package")
 [1] "Foo"
!> shortName(sb)
 Error in assign(".SigLength", nsig, envir = env) (from Test.R#13) :                                                
   cannot add bindings to a locked environment

In a way, it's the first line that is the strangest.  StandBonf has been defined in namesapce Foo (my test package) and Foo does not export it.  But I'm able to see and use it.  But then when I attempt to invoke a method on it I get the binding error.

If Test.R is part of the source package when it is installed this happens (even if Test.R is read in via C-c C-l):
 > sb <- StandBonf(alpha=0.1)
 Error: could not find function "StandBonf"




More information about the ESS-help mailing list