0

Last night I spent 4 straight hours compiling observations into a data frame in R. I saved the data frame as an object and then closed my laptop and decided to finish the observations in the morning. When I opened my laptop today, R studio had been closed out from closing my laptop even though I didn't shut it off. When I opened it, it took me to my previous session with the same script, but my data frame is no longer saved as an object. It took me so long to collect all the data last night. Does R save any kind of history of objects where I can recover it? For some reason R studio has saved other previous objects I defined but not this one. Why did R keep other objects in the environment but not this one?

Johnny
  • 59
  • 5
  • 1
    Did you try `.Last.value` ? – G5W Dec 18 '22 at 21:20
  • If not `.Last.value` (with which I don't hold out much hope, admittedly), then ... sorry, I think you've lost it. There is no "incremental save as you go". (Which is good for me, the multi-GB datasets I work with would absolutely _clobber_ my workspaces.) – r2evans Dec 18 '22 at 21:40
  • 1
    It doesn't make sense that R would keep some objects but not other in your global environment. Something doesn't quite checkout with this story. Without any sort of [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) that we can use for testing and debugging it's hard to give any specific advice. How exactly did you compile this data? Do you have R setup to automatically save your workspace? Do you have an .Rdata file in your home directory? What OS and R version are you using? – MrFlick Dec 18 '22 at 22:09

0 Answers0