Question

I am from Denmark and need to be able to use danish letters in my R-code.

If I add some code like:

print("Århus er bare øv...")

and save it as an R-script file in R-studio, the next time I open the file in R-studio I get:

print("?rhus er bare ?v...")
Was it helpful?

Solution

When saving your file, use File -> Save with encoding and select e.g. "UTF-8". If the file is read incorrectly next time, use File -> Reopen with encoding.

You may also change the RStudio preferences (Tools -> Global options / General->Default text encoding) and set "UTF-8".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top