.Rmd files open as completely empty

11,047

Solution 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:

  1. Opening the file in RStudio as you normally would (the file will be empty)
  2. Navigate to File -> Reopen with Encoding...
  3. 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

Solution 2

In RStudio go to:

  1. Tools
  2. Global Setting
  3. Left hand side "Code" a. under "Saving" - Default text econding: change to UTF-8
Share:
11,047

Related videos on Youtube

SpacemanSpiff
Author by

SpacemanSpiff

Updated on October 16, 2022

Comments

  • SpacemanSpiff
    SpacemanSpiff over 1 year

    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

    • neilfws
      neilfws almost 7 years
      Linked file opens fine for me in latest RStudio 1.0.143.