6

I'm a mac user and want to change R locale to English.

I know defaults write should set R's locale on osx. But, strangely, the command doesn't work.

defaults write org.R-project.R force.LANG en_US.UTF-8

When I launch R by executing R.app, English messages are properly shown, but Terminal.app shows Japanese messages:

R.app Terminal.app

My Environment is as follows:

  • Mac OS 10.8.5
  • R version 3.0.1 (2013-05-16) -- "Good Sport" Platform: x86_64-apple-darwin10.8.0 (64-bit)

Result of sessionInfo() on Terminal:

> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

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

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

On R.app:

R version 3.0.1 (2013-05-16)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

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

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base    

loaded via a namespace (and not attached):
[1] caret_5.17-7    grid_3.0.1      kernlab_0.9-18  lattice_0.20-15
plannapus
  • 18,529
  • 4
  • 72
  • 94
Light Yagmi
  • 5,085
  • 12
  • 43
  • 64
  • What is the output of `sessionInfo()` in both cases? – Dason Nov 05 '13 at 02:41
  • @Dason Thank you. I put the output of sessionInfo() [here](http://pastebin.com/ZzGXeLbb). – Light Yagmi Nov 05 '13 at 04:50
  • 1
    See [here](http://stackoverflow.com/questions/12642651/in-r-how-to-get-error-messages-in-english), for both answer as well as Paul Hiemstra's comment: basically instead of calling `r` in the terminal you can call `LC_ALL=en_GB r` for instance and you can make it permanent by adding it to the `~/.bashrc` file. Your `defaults write...` solution indeed affect only R.app. – plannapus Nov 05 '13 at 08:36
  • `Language=en R` works perfectly! Thank you, @plannapus. – Light Yagmi Nov 05 '13 at 08:55
  • 2
    @plannapus or put it in `.Renviron` to affect R everywhere – hadley Nov 06 '13 at 14:31
  • @handley Great. I love the way you mentioned. Thank you. – Light Yagmi Nov 08 '13 at 00:53

1 Answers1

4

As @plannapus wrote, starting R with Language=en R works well in my environment. See here.

Thank you for your help.


edit (2013/11/8)

According to gentle community replies, there seems to be several solutions. As for me, both of these ways works well.

  1. Launching R console with specifying language as Language=en R (already mentioned previous post)
  2. Set environment variable by adding just one line Language=en R to ~/.Renviron
Community
  • 1
  • 1
Light Yagmi
  • 5,085
  • 12
  • 43
  • 64
  • 2
    For future reference, `R` questions which are specific to OS X can be submitted to the r-sig-mac mailing list. The folks there are quite knowledgeable about stuff like this. – Carl Witthoft Nov 05 '13 at 12:37
  • @Carl r-sig-mac looks great. I'll subscribe it. Thank you. – Light Yagmi Nov 05 '13 at 13:31