R file suddenly became blank and 0kb when reopening it

I updated my R version to 4.2 last week. After that, I was not able to open code that was previously written. I googled it and solved the problem by setting the encoding to UTF-8. Everything was fine afterwards.

However, something horrible happened today. I wrote two new R scripts using R version 4.2 after this update. Today, when I open my computer and tried to continue to work on these two scripts. They became empty and 0kb - the changing encoding won't work too. I tried to open them with notepad and other text editors - empty too.

All scripts that I wrote with R 4.1.2 can still be opened. Just those two files written with 4.2 become empty...I am nearly desperate now as they are super important for me work and I may need to re-do everything again. Does anyone have any idea about what happened and how to resolve it?

Are you using an old RStudio version? This was an issue with R 4.2 and old RStudio versions but it was solved since version 2022.02.3

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.