Hello,
Somewhere in my S3 package "foo" I want to create, on the fly, a new
S4
class which extends another S4 class "bar".
setClass("fooS4bar", representation("bar", bar.data =
"data.frame"),
where = parent.env(environment()))
where "where" is the environment of my "foo" package.
But I get:
Error in assign(classMetaName(Class), def, where) :
cannot add bindings to a locked environment
Is there any way to unlock the package environment, add a binding and
lock it back? How the environment of my own package got locked on the
first place?
Thanks for your help,
Ferdinand
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