Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
538 views
in Technique[技术] by (71.8m points)

windows - The R console is in my native language, how can I set R to English?

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_HOMEetc (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_HOMEetc - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

On a fresh install, adding language = en to the Rconsole file (which exists by default under R_HOMEetc) 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...