[R] unlock package environment ?

Ferdinand Alimadhi falimadhi at iq.harvard.edu
Mon Dec 4 21:31:15 CET 2006


Hello,

Inside my S3 packages "foo" Im trying to create an S4 class which 
extends another S4 class "bar".

setClass("fooS4bar", representation("bar", foo.data = "data.frame"), 
where = parent.env(environment()))

But I get:

Error in assign(classMetaName(Class), def, where) :
        cannot add bindings to a locked environment

 (Note: it works fine if  where = .GlobalEnv  but I want it to be 
created in my package environment !!)

Is there any way to unlock the environment add some bindings and then 
lock it back. How the environment of my own package got locked in the 
first place?

Thanks for your help
-Ferdi




More information about the R-help mailing list