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

r, rstudio

Solution

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

Problem

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?

Original source