问题
When opening .rmd files in RStudio 3.3.2, they show up as completely empty. There is text if I open using Notepad or if I open on another machine. What is going on?
RMD file in question
回答1:
I had a similar issue with older R files that opened as empty. It turned out that RStudio didn't use the correct encoding as default and therefore wasn't able to read the file (presented the file as empty).
You can make sure that you are using the correct encoding by:
- Opening the file in RStudio as you normally would (the file will be empty)
- Navigate to File -> Reopen with Encoding...
- Select UTF-8 and click OK
UTF-8 will most likely be the encoding you need. You can also choose to set this as the default for all source files.
This issue was also addressed on RStudio Support
回答2:
In RStudio go to:
- Tools
- Global Setting
- Left hand side "Code" a. under "Saving" - Default text econding: change to UTF-8
回答3:
save @Richard N mentioned, save the files with "UTF-8" encoding. Will solve the issue. Incase you saved the files without encoding, use the open with encoding option under "Files" tab.
来源:https://stackoverflow.com/questions/44298161/rmd-files-open-as-completely-empty