Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

r - axis labels are not plotted in English

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
See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...