I´ve updated R on my laptop from version 4.0.3 to version 4.2.0. When I try open some of my old scripts in Rstudio, it shows an empty window. Also when I download some script I have the same problem. It is interesting, that only one script works ok, so there isn´t any problem with installation of R or Rstudio. Could somebody help me? Thanks in advance.
Asked
Active
Viewed 2,975 times
1
-
Could you provide a [minimal reproducible example](https://stackoverflow.com/a/5963610/13513328) of such a script? – Waldi May 03 '22 at 08:50
-
Hi, do you mean adding some script here? – Tomas Piskovsky May 03 '22 at 09:10
-
Yes, adding the simplest script you have which gave a result previously and returns an empty window now. Try to reduce it only to the few lines causing the problem. In doing so, you might as well find yourself the reason of the problem. If not, glad to help further. – Waldi May 03 '22 at 09:21
-
Well, maybe I´m dumb, but I don´t know how to attach the file here... – Tomas Piskovsky May 03 '22 at 09:56
-
Try `ctrl+K` to add code, or press `{}` icon in the editor – Waldi May 03 '22 at 12:04
-
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community May 04 '22 at 09:11
1 Answers
8
I think this is an encoding issue.
This worked for me (exact same problem with R 4.2.0 in Rstudio on Win11).
"Set the encoding by default to UTF-8:
- Click on Tools (2nd option starting by the left on the top menu).
- Choose Global Options.
- An option box will appear. There choose "code" on the left menu. Under code, choose Savings and change the Default Text Encoding to UTF-8.
Now the files that were open as blank should appear with code."
See: https://github.com/ContinuumIO/anaconda-issues/issues/1609

Paul Turner
- 81
- 2