[R] Saving environment object

Luke Tierney luke at stat.uiowa.edu
Fri Aug 15 15:19:11 CEST 2008


On Fri, 15 Aug 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

save/load works fine (and is used in many places):

> e<-new.env()
> assign("e", e, envir = e)
> assign("x", 2, envir = e)
> save(e, file = "test.Rda")
> rm(e)
> load("test.Rda")
> e
<environment: 0x1c2c748>

There may be something about the values you are using that is causing
problems, but there is no way to tell without a reproducible example.

luke

>
> Regards,
>
> benjamin
>
> ======================================
> Benjamin Otto
> University Hospital Hamburg-Eppendorf
> Institute For Clinical Chemistry
> Martinistr. 52
> D-20246 Hamburg
>
> Tel.: +49 40 42803 1908
> Fax.: +49 40 42803 4971
> ======================================
>
>
>
>

-- 
Luke Tierney
Chair, Statistics and Actuarial Science
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa                  Phone:             319-335-3386
Department of Statistics and        Fax:               319-335-3017
    Actuarial Science
241 Schaeffer Hall                  email:      luke at stat.uiowa.edu
Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu



More information about the R-help mailing list