Content of .R file deleted - not the file, but the content

Greetings!

I just had a rather unfortunate experience and i'm not entirely sure whether its a R or Rstudio issue.

On my plain old local disk running Windows10, Rstudio 1.1.456 and R 3.5.1 - I was creating a gif using the magick package when I got an error saying something along the lines of 'file not reachable' and then when I closed Rstudio the .R file inside my project got completely wiped of all code and I now have an empty .R file even though the file itself still exists inside my project directory. I'm absolutely positive that I did not delete or move the file and somehow the troubles seemed to start when I tried to save the gif I created with a .mp4 extension.

I couldn't restore windows to an earlier point so I guess my chances of getting my code back are slim to none.

But do anyone have a clue what went wrong? and perhaps suggestions for getting my code back?

Thanks!

wow, that's really wild. I have not run into anything like this, but debugging is going to be hard because, by definition, you can't post the code that caused the problem. Which makes it hard to reproduce.

Are you running any background file monitoring software like OneDrive or GoogleDrive? Sometimes they produce file history that allows rolling back changes.

Hello,
I had exactly the same problem. I'm to R and Rstudio, so my code is extremely simple, but sometimes, it justs kind of disappear !
I still have the file, but it's completly clear of my code.
I have also Rstudio version 1.1.456 and R 3.5.1. I tried with anaconda distribution, and experienced the same issue...
So I edit the file with a text editor (Notepad++), they were blank. I retyped my code in that editor, and open it in Rstudio. It works for few minutes, and go blank again !
What is extremely strange is that I kept open the file with my text editor, I still have the code, but in Rstudio, it's blank ! I closed Rstudio, restart it, re-open the file, and it's blank !!
Rstudio just won't read that R file anymore...

Sorry for the trouble!

A diagnostics report could potentially be helpful -- if we're luck, some kind of warning / error may have been logged at the time when the file contents were lost.

Are you using any 3rd-party cloud synchronization services (e.g. Dropbox)? Can you think of anything that might make your environment unique relative to a typical at-home desktop environment?

R Studio also deleted the contents of all files that had previously been open on my computer. I had saved my files a number of times, but this morning when I opened R all of the files that had previously been open were entirely blank. Luckily files that were not open were not wiped, but I would like to avoid this problem in the future. I joined R Studio Community to report this and see if I could find out what happened. I am also running Windows 10 and I have R Studio version 3.5.0.

Unfortunately those entries in the diagnostics report are most likely unrelated to whatever might have occurred.

Are you using any 3rd-party cloud synchronization services (e.g. Dropbox)? Can you think of anything that might make your environment unique relative to a typical at-home desktop environment?

I ran a diagnostics report and have about 10 copies of this error around the time that I closed the file last night:

07 Feb 2019 19:45:35 [rsession-Alain Gomez] CLIENT EXCEPTION (rsession-Alain Gomez): (TypeError) : undefined is not an object (evaluating 'this.a.a.r.row');|||com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Exceptions.java#28::wrap|||com/google/gwt/core/client/impl/SchedulerImpl.java#167::runScheduledTasks|||com/google/gwt/core/client/impl/SchedulerImpl.java#338::flushPostEventPumpCommands|||com/google/gwt/core/client/impl/SchedulerImpl.java#76::execute|||com/google/gwt/core/client/impl/SchedulerImpl.java#140::execute|||com/google/gwt/core/client/impl/Impl.java#244::apply|||com/google/gwt/core/client/impl/Impl.java#283::entry0|||#-1::anonymous|||com/google/gwt/cell/client/AbstractEditableCell.java#41::viewDataMap|||Client-ID: 33e600bb-c1b1-46bf-b562-ab5cba070b0e|||User-Agent: Mozilla/5.0 (Windows NT 6.2 WOW64) AppleWebKit/538.1 (KHTML, like Gecko) rstudio Safari/538.1 Qt/5.4.1