1

R studio desktop froze up, and I lost everything. I've checked the Environment/History panel, and I'm not showing the project instead, I'm showing older projects. Is there a way to autosave my work on the R studio desktop to prevent this from happening again?

Dave2e
  • 22,192
  • 18
  • 42
  • 50
  • 2
    first i would open up the .rproj file again--if rstudio crashed and you open it again, you may have a blank workspace but your unsaved changes are actually under the project directory. second if i ever close or crash, i always have even my unsaved scripts pop up again when i re-open as i mentioned. third are you just talking scripts? i do not like to save objects/workspace in rstudio, that forces you to be reproducible and mobile. in fact, i regularly restart and clean the workspace. finally it sounds like you are asking if objects/workspace will be saved automatically on crash, is that right? – rawr Jan 06 '22 at 03:56

1 Answers1

0

RStudio does back up your changes. It should bring them up by itself if you re-open your project, but see e.g. here where you can find them directly.

Moreover, you can customize this behavior under Tools/Global Options/Code/Saving:

RStudio options dialog

Perhaps the right choice for you is not just backup, but actually save "when editor loses focus".

Lastly, it is highly recommended to use some source control - this won't just avoid losing your work, it would enable accessing all past versions of it.

Ofek Shilon
  • 14,734
  • 5
  • 67
  • 101