Rstudio deleted Rmd source

Rstudio started behaving oddly, for instance not executing source as I Ctrl+Entered it. So I closed it, got a strange message about not being able to connect two browsers simultaneously, and restarted it.

My source .Rmd file is empty. A check of explorer confirms my fears: 0 B size.

Not a happy camper here. There's no .html file that I might be able to recover my program from either.

Is there anything else I could look at before I curse loudly and angrily?

Sorry I don't have anything to propose regarding the recovery, but for future projects I'd recommend using RStudio's Projects along with a version control software like GIT.

Thanks for that.

I'm already using both of those so I didn't lose all my work, just the last few hours

Did you check if there is anything left in RStudio's history tab?

I've heard of such problems when scripts are being edited on filesystems which are being synced/backup like onedrive for example.

Ah, I didn't think of looking there, but thanks. I'll bear it in mind for next time.

(ps, your avatar is apropos!)

Indeed :sweat_smile:...

This won't help right now but maybe in the future:
You might want to check RStudio's auto-save capabilities: Tools -> Global options... -> Code -> Saving-> Auto-save

Interesting. Wonder if it's just onedrive, which seems to have a certain reputation for eating file systems.

Isn't that the default?

image

Choice there seem to be backup or save/write (or nothing). Not sure what the difference is. Is there a separate backup file somewhere?

Yes - that's the default. It refers to the script file you are editing. AFAIK thre is no separate backup. However, maybe check the locations mentioned here.

This answer is also interesting.

Ah-ha!

...\AppData\Local\RStudio\history_database seems to contain some/most of what I lost. Thanks!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.