7

R doesn't plot automatically the axis labels in English (for example Months are in French). I use (if the information is useful...):

  • windows (and I have already changed "language = en" in .../Programs/R/etc/Rconsole to make R speaking English)
  • RStudio
  • ggplot2

I know that I am not the only one with this issue but I never found a solution.

> sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252 LC_MONETARY=French_France.1252 LC_NUMERIC=C LC_TIME=French_France.1252
lmo
  • 37,904
  • 9
  • 56
  • 69
user2165907
  • 1,401
  • 3
  • 13
  • 28
  • 2
    Include the output of `sessionInfo()`. It's likely that you still haven't set your locale correctly. – joran Mar 15 '13 at 17:20
  • OK, I see a lot of Frenchy stuff in that locale... Would you know how to modify this? Thanks – user2165907 Mar 15 '13 at 17:30
  • Try the suggestions found in `?locales` first and see how that works. (But read carefully, setting locales is something people often get tangled up on.) I'm in the US and most of my locales are set to `en_US.UTF-8`. – joran Mar 15 '13 at 17:32
  • Did you say you had already tried what is outlined here? http://stackoverflow.com/questions/13575180/how-to-change-the-language-of-errors-in-r/13575413#13575413 – Chase Mar 15 '13 at 17:34
  • Yeah, what @Chase said. That was going to be my next suggestion. – joran Mar 15 '13 at 17:35
  • Yes, this change the language for R warnings in the console but my axis (Months) are still plotted in French. – user2165907 Mar 15 '13 at 17:43
  • The change of locales seems to be promising. I don't have time to check it right now but I will post an answer next week if successfull. – user2165907 Mar 15 '13 at 17:53

2 Answers2

14

To change language of the environment use the following command:

Sys.setenv("LANGUAGE"="En")

To change locale to English:

Sys.setlocale("LC_ALL", "English")

The name of the locale depends on what is installed on your system (for example, you might use "en_GB.UTF-8" instead of "English").

user2165907
  • 1,401
  • 3
  • 13
  • 28
0

The locale you see in sessionInfo() is system wide specific, go to windows regional options and change from french to english then restart R and you should see English instead of french...but this is only if you want do it quick and dirty, it will then be applied system wide. Else ?locale should explain and to do it more surgically

statquant
  • 13,672
  • 21
  • 91
  • 162