.Rmd 文件打开时完全为空 [英] .Rmd files open as completely empty
问题描述
在 RStudio 3.3.2 中打开 .rmd 文件时,它们显示为完全空白.如果我使用记事本打开或在另一台机器上打开,则会出现文本.这是怎么回事?
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?
推荐答案
对于打开为空的旧 R 文件,我遇到了类似的问题.事实证明,RStudio 没有使用正确的默认编码,因此无法读取文件(将文件显示为空).
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:
- 像往常一样在 RStudio 中打开文件(文件将为空)
- 导航到文件 -> 使用编码重新打开...
- 选择 UTF-8 并点击确定
UTF-8 很可能是您需要的编码.您也可以选择将其设置为所有源文件的默认值.
UTF-8 will most likely be the encoding you need. You can also choose to set this as the default for all source files.
此问题也在 RStudio 支持
这篇关于.Rmd 文件打开时完全为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!