Playing with Binding and Environment Adjustments in R , we have this 3 functions:
lockEnvironment(env)
locks env so you can\'t add a new symbol to
I think the best you can do is make a new unlocked environment. You could either copy all the fields, or make the existing one a parent of the new one. That means all the existing variables get inherited.
unlockEnvironment <- function (env) {
return (new.env(parent=env))
}
e <- unlockEnvironment(e)