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?
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.
it should be the Rconsole file, instead of Rprofile.site.
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.
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):
- Control Panel
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
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