Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the character encoding of .R file in RStudio?

Tags:

r

rstudio

I want to save all .R file in one type of encoding, it is inconvenient to switch encodings everytimes I open a file, so, how to change the character encoding of .R file in RStudio?

like image 842
ChaoYang Avatar asked Feb 05 '14 13:02

ChaoYang


3 Answers

R 3.4.3; RStudio 1.1.383

Tools > Global Options > Code > Saving > "Default text encoding" [Change]

enter image description here

like image 189
Maria Wollestonecraft Avatar answered Sep 28 '22 16:09

Maria Wollestonecraft


You can try this. Go in "File" menu and then "Save with encoding..."

like image 43
Pop Avatar answered Sep 28 '22 17:09

Pop


Tools - Options - General - Default text encoding:

enter image description here

like image 20
James Avatar answered Sep 28 '22 15:09

James