Hi all, I just had a rather unpleasant experience. After considerable work I finally got a script working and set it to run. It had some memory allocation problems when I came back so I used Windows to stop it. During that process it told me that the script had been changed and asked if I wanted to save it. Not being positive that I'd saved the very last changes I said yes. Now when I turn on R again the script is now completely blank. I guess my questions are: Is there a way to interrupt a program without using Windows? Is there anyway to recover my script? And a nice to know: Anybody know why it saved blank space as the new script? Thanks for any advice. A humble, and humbled, new R user. -- Best regards, David Young Marketing and Statistical Consultant Madrid, Spain +34 913 540 381 http://www.linkedin.com/in/europedavidyoung mailto:dyoung at telefonica.net
On 10/28/2009 11:37 AM, David Young wrote:> Hi all, > > I just had a rather unpleasant experience. After considerable work I > finally got a script working and set it to run. It had some memory > allocation problems when I came back so I used Windows to stop it. > During that process it told me that the script had been changed and > asked if I wanted to save it. Not being positive that I'd saved the > very last changes I said yes. Now when I turn on R again the script > is now completely blank.Are you sure you're looking at whatever file was saved? You may be looking at a different file. If you really did lose your content, then I think the usual general advice applies: don't kill a process that contains unsaved data, because you might lose it.> > I guess my questions are: > Is there a way to interrupt a program without using Windows?Hit the escape key. R checks for that at regular times, and aborts calculations. It is possible to run things that don't do the checks, so it isn't guaranteed to work.> Is there anyway to recover my script?Recover it from a backup. Use a version control system so that you have backups routinely on request (and remember to request it), or a backup system like Time Machine on MacOS so you have hourly backups automatically.> And a nice to know: > Anybody know why it saved blank space as the new script?No, but if you can make it happen reproducibly when it shouldn't, we'll try to fix it. Duncan Murdoch> > Thanks for any advice. > > A humble, and humbled, new R user. > > > >
To stop in Rgui mode, you can try pressing the ESC key. If you are using within emacs, change to R buffer and try C-c C-c to stop it. I am not sure how to recover the script (emacs usually makes a .R~ backup). Maybe if you still have the output printed to screen or terminal make a copy of it - you may be able to rewrite with some work. If your machine is backed up on regular basis, then try to get the last available backup. Also note that you can view the same file (even while it is in the R session) using notepad etc externally. So next time, if you face a similar situation then you can check/save externally first. Regards, Adai David Young wrote:> Hi all, > > I just had a rather unpleasant experience. After considerable work I > finally got a script working and set it to run. It had some memory > allocation problems when I came back so I used Windows to stop it. > During that process it told me that the script had been changed and > asked if I wanted to save it. Not being positive that I'd saved the > very last changes I said yes. Now when I turn on R again the script > is now completely blank. > > I guess my questions are: > Is there a way to interrupt a program without using Windows? > Is there anyway to recover my script? > > And a nice to know: > Anybody know why it saved blank space as the new script? > > Thanks for any advice. > > A humble, and humbled, new R user. > > > >
Hi David,>> Now when I turn on R again the script is now completely blank.This happened to me about 4--5 months ago under Vista. I cannot quite remember what I did but I think I got the script working by opening it in another editor (a hex editor would do) and removing either the first few bytes or the last few bytes. If you still have the file try this route. Good luck, Mark. David Young-18 wrote:> > Hi all, > > I just had a rather unpleasant experience. After considerable work I > finally got a script working and set it to run. It had some memory > allocation problems when I came back so I used Windows to stop it. > During that process it told me that the script had been changed and > asked if I wanted to save it. Not being positive that I'd saved the > very last changes I said yes. Now when I turn on R again the script > is now completely blank. > > I guess my questions are: > Is there a way to interrupt a program without using Windows? > Is there anyway to recover my script? > > And a nice to know: > Anybody know why it saved blank space as the new script? > > Thanks for any advice. > > A humble, and humbled, new R user. > > > > > -- > Best regards, > > David Young > Marketing and Statistical Consultant > Madrid, Spain > +34 913 540 381 > http://www.linkedin.com/in/europedavidyoung > > mailto:dyoung at telefonica.net > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > >-- View this message in context: http://www.nabble.com/Lost-all-script-tp26096908p26101731.html Sent from the R help mailing list archive at Nabble.com.