Pergunta

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...")
Foi útil?

Solução

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".

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top