Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.Rmd files open as completely empty

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

like image 948
SpacemanSpiff Avatar asked Jun 01 '17 03:06

SpacemanSpiff


2 Answers

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

like image 106
ToT Avatar answered Sep 20 '22 19:09

ToT


In RStudio go to:

  1. Tools
  2. Global Setting
  3. Left hand side "Code" a. under "Saving" - Default text econding: change to UTF-8
like image 40
Richard N Avatar answered Sep 20 '22 19:09

Richard N