From p.dalgaard@biostat.ku.dk  Wed Jul  8 15:52:03 1998
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 08 Jul 1998 16:52:03 +0200
Subject: Serious bug in save.image
In-Reply-To: Martyn Plummer's message of Wed, 08 Jul 1998 11:47:05 -0000 ()
References: <XFMail.980708124450.plummer@iarc.fr>
Message-ID: <x2pvfg2y5o.fsf@blueberry.kubism.ku.dk>

Martyn Plummer <plummer@iarc.fr> writes:

> function () 
> save(list = ls(), file = ".RData")
> 
> The expression "ls()" is evaluated in the calling environment, which
> is empty. You need to evaluate it in the global environment, like this:
> 
> function () 
> save(list = eval(expression(ls()), .GlobalEnv), file = ".RData")

Ouch! Fixed in my sources. Will get to the prerelease versions after I
squash an elusive memory corruption bug.

Actually, I did you one better:

> save.image
function (f = ".RData") 
eval(substitute(save(list = ls(), file = f)), .GlobalEnv)

so that you can now save the image under a different name.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


Serious bug in save.image
Peter Dalgaard BSA