[R] Saving environment object

Erik Iverson iverson at biostat.wisc.edu
Fri Aug 15 15:36:49 CEST 2008


Benjamin Otto wrote:
> Hi,
> 
> When I create an environment object with new.env() and populate it with
> values then how can I save it into an .RData file properly, so it can be
> loaded later on in a new session?
> 
> Saving an environment object with save() or save.image() results in an error
> message when loading again:
> 
> Error: protect(): protection stack overflow

Can you give a small, reproducible example as the posting guide asks? 
And also provide your sessionInfo() ?

I am not able to replicate this.

test <- new.env()
assign("hi", pi, pos = test)
save(test, file = "~/testenv.Rdata")

does not give me an error.  Is this basically what you're trying?



More information about the R-help mailing list