[R] PowerCut Killed R - is my code retrievable?

Rolf Turner r.turner at auckland.ac.nz
Thu Aug 20 00:13:56 CEST 2009


On 20/08/2009, at 9:57 AM, Polwart Calum (County Durham and  
Darlington NHS Foundation Trust) wrote:

> I've been tweaking code for several days on and off in R, cut and  
> pasting in from a text editor (I just leave them open all the  
> time).  I think I got something that was usable but then a  
> powersurge tripped the fuses and unfortunately the machine I was  
> working on doesn't have a UPS.
>
> Does R hold the command data in cache some place?  I've  
> purposefully not opened R since the crash so that if it did I don't  
> over write it?
>
> I guess what I'm wanting is the equivalent of the linux up arrow  
> which repeats the last line.  i know that exists in R but from what  
> I recall it didn't work when you close the R session.  Is that  
> stored in a hidden file someplace that I could copy?
>
> Its not a huge piece of code or anything - but it was code I  
> tweaked over several stages as I'm new to R and so it was part of  
> my learning process.
>
> Also - is there a better way for the future?  I know some people  
> use IDE's but is that for serious programming or for building a  
> small function and tweaking it?

If you've been cut-and-pasting from a text editor, then your commands
*might* be in the file .Rhistory.  Unfortunately this history gets saved
only when you exit R (and by default only when you also say ``yes'' to
saving the workspace) or if you explicitly savehistory().

After a powersurge, the R workspace and history almost surely will  
not be
saved, so it is highly probable that you are SOL.  Unless you closed
the R session (and save the workspace) before the power cut.  Bummer.

Good luck.

	cheers,

		Rolf Turner

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}




More information about the R-help mailing list