0

Whenever I open an old script in RStudio, all the text is GONE. I'm currently cleaning up an old script and noticed one data.table was off. I tried opening my last version of the same code to see if I accidentally deleted something, and when I opened it all the text was missing.

I tried restarting RStudio and opening the script in Notepad, but neither had the text. The original file I attempted to open, the size is now 0KB. Others I tried have kept their original size after my attempts. I tried changing the text encoding (Tools -> Global Environment -> Code -> Saving) to Default and UTF-8, per other posts (What is causing my R script text to disappear?). Note, my default is ISO-8859-1, not UTF-8 like the post's author. However, that did not work either. From what I can tell I need to change the Project coding from CP936, but I don't know where to look for that, nor how to change it.

I updated my software earlier this week to version 4.2.2. Not sure if that could be playing into this. I'm also running version 1.2.5 of RStudio.

Edit: My question was closed citing similar examples. The one cited in the above text and this question: Problem with opening scripts in updated version of R.

However, I have already tried the solutions in these examples and they do not work for me.

DPek
  • 180
  • 2
  • 15
  • RStudio has a menu item "Reopen with encoding..." that let's you try a different encoding. On a Mac, it's in the File menu; probably the same on whatever system you're running. The files that are 0 bytes are gone; you should recover them from backups. If you don't have backups, you're out of luck. – user2554330 May 18 '23 at 23:07
  • @user2554330 I checked this out while I had a script open. It was already set to system default. I hit ok and the script I had open was wiped and is now 0KB in my file explorer. I have a way to restore back ups thankfully. – DPek May 19 '23 at 13:30

0 Answers0