71

I am using R on Windows 7. Apparently R somehow found evidence that I speak languages besides English, and stubbornly insists on giving output in the console in my own language. For a variety of reasons, this is undesirable, and I want R to be English.

What works

I am able to use LANGUAGE=en as a command line option for the R console desktop shortcut, but the language is still wrong in Rstudio, which launches the R executable directly and hence ignores the command line arguments in the shortcut.

What doesn't work

I have tried creating an .Renviron file under C:\Users\[MY_NAME]\Documents, which is the path returned for the working directory by getwd(), with LANGUAGE=en in it. R ignores this. My R_ENVIRON and R_ENVIRON_USER variables show up as "" so .Renviron should be the correct filename.

I have also tried creating .Renviron under R_HOME\etc (R_HOME points to C:/PROGRA~1/R/R-215~1.0) and R also ignores it.

I was somewhat successful with adding Sys.setenv(LANGUAGE="en") in R_HOME\etc - this made all output from the R console English, except for the initial copyright information.

The question

How can I make R default to English such that this is propagated to RStudio?

Superbest
  • 25,318
  • 14
  • 62
  • 134

6 Answers6

47

On a fresh install, adding language = en to the Rconsole file (which exists by default under R_HOME\etc) will make R's language English in the R console as well as RStudio. This can be overridden by code in the working directory and RStudio's individual projects.

Marco Demaio
  • 33,578
  • 33
  • 128
  • 159
Superbest
  • 25,318
  • 14
  • 62
  • 134
  • 4
    As @fffchao says: "it should be the Rconsole file, instead of Rprofile.site" – Daniel Camacho Jun 11 '14 at 18:11
  • 3
    Note: Under Win 8, I had to run Wordpad with elevated privileges (go to top right, search wordpad, run with Ctrl+Shift+Enter) to be able to edit `Rconsole`. – sancho.s ReinstateMonicaCellio Oct 01 '15 at 12:12
  • 1
    Superbest's initial answer was flawed, and he/she changed after I posted my correct answer. He/she should give credit to me. – fffchao Sep 06 '16 at 15:39
  • 3
    @fffchao I'm quite confused. When I posted this answer, it referenced `Rprofile.site`. I had discovered that at the time, this was a viable method of changing the language. I had tried it and it worked (at least at the time). It appears that Marco has decided to "correct" my answer (an edit against the rules since it changes the intent, in fact) in 2015 to say `Rconsole` (which at the time I had found to *not* work). Now you are accusing me of stealing your credit, when I had posted and accepted my answer the year prior to you posting yours. – Superbest Sep 07 '16 at 04:17
  • 4
    @Superbest original suggestion to add `Sys.setenv(LANGUAGE="en")` to `Rprofile.site` worked for me in R 3.6.2 on Windows 7 Ultimate K. But, the easiest solution is to uninstall R and reinstall. Un-click the "translate error messages" during re-insulation. This way everything will be in English, including the initial copyright information, and you don't need to edit any files. This is true when running R or RStudio. The following discussion provides more information: [How to change language settings in R](https://stackoverflow.com/questions/13575180/how-to-change-language-settings-in-r). – Ike Jan 03 '20 at 04:00
21

First, go to the etc folder under R program files folder. Then locate Rconsole file. Find the line language =, change it to language = en if you want to run R in English.

Note: right click on the Rconsole file icon, select Property and grant yourself the permission to modify the file.

mynameisJEFF
  • 4,073
  • 9
  • 50
  • 96
14

it should be the Rconsole file, instead of Rprofile.site.

fffchao
  • 174
  • 3
  • 8
14

The problem is not in R or in RStudio, the problem is in your Windows language configuration.

If you are using Windows, you have to set it like this (e.g. Windows 7):

  1. Control Panel
  2. Region and language.

    2.1. Go to the Tab "Administrative"

    • "Language for non-Unicode programs", then set it in the "Change system locale" button.

    2.2. If you want, you can set it also the Tab "Format" in Format.

Cheers, Darwin PC

Darwin PC
  • 871
  • 3
  • 23
  • 34
  • 4
    This fixed my problem that I was having with a bunch of programs – chandler Jan 31 '14 at 20:30
  • This would likely break encoding many programs in said native language (for example, when I had Japanese locale, files opened in Notepad with Polish characters in them would display random Japanese glyphs instead of them, and Polish version of Winrar displays question marks instead of Polish characters). – Noctiphobia Apr 20 '17 at 23:05
  • I think the problem originate from window system does not support utf-8. In 2019, there exist a beta version in windows for supporting `non-Unicode programs` displaying. @Noctiphobia – Travis Dec 13 '19 at 03:49
11
  1. Go into R installation directory, i.e. C:\Program Files\R\

  2. From there go into the subfolder etc/

  3. Open with a text editor (i.e. Notepad) the file Rconsole

  4. Look into the file for the line language =

  5. Replace such line with language = en

  6. Save and close the Rconsole file, then run Rgui again, and the interface will be in English

R version 3.1.3

Marco Demaio
  • 33,578
  • 33
  • 128
  • 159
2

I had the same problem. I solved it by changing my laptop's system preference->region as US. Then, re-install the R. The system language changed ultimately to english.

sessionInfo()

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

Jia Yang
  • 41
  • 2