Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default language of R

Tags:

macos

r

I have the R software installed on my MacBook, but the problem is that the default language is set on "russian", I really don't know why. When I call R from my terminal I see the message below

Giulios-MBP:~ opisthofulax$ R

R version 3.2.4 (2016-03-10) -- "Very Secure Dishes"
Copyright (C) 2016 The R Foundation for Statistical Computing
R version 3.2.4 (2016-03-10) -- "Very Secure Dishes"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.4.0 (64-bit)

R -- это свободное ПО, и оно поставляется безо всяких гарантий.
Вы вольны распространять его при соблюдении некоторых условий.
Введите 'license()' для получения более подробной информации.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Введите 'demo()' для запуска демонстрационных программ, 'help()' -- для
получения справки, 'help.start()' -- для доступа к справке через браузер.
Введите 'q()', чтобы выйти из R.

> 

As you can notice the software is half in russian half in english, and, obviously, I would like to change the default language to ENG.

I've found a temporary solution here on StackOverflow but it doesn't solve my problem, because every time I call R from my terminal it's again in RUS.
I was wondering if there's a definitive solution/command to change and set the default language to ENG. Thanks all.

= I didn't get the problem solved, since, even if I took a look here, on the other SO link.
I wasn't able to locate the file Rconsole, which seems to be the key to change the language.
I looked for it on my MacBook (and maybe the problem is because of the new Sierra OS) with the search tool, but the file seems not to be on my computer.
So the problem is actually still there. Any suggestion?

like image 721
opisthofulax Avatar asked Dec 27 '16 22:12

opisthofulax


People also ask

How do I change my R language to English?

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.

How do I change the language in R studio?

You may select the language of R‑Studio main panel and its help. To do so, select an available language on Change Language on the Help menu.


1 Answers

There are several questions dealing with that problem:
- How to change language settings in R
- The R console is in my native language, how can I set R to English?

Type locale in the terminal and check your language settings. If you want everything to be in US english, it should look like this

locale 

LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

In your case, I assume that it is a mix of en_US.UTF-8 and your local russian language setting.

These variables are set system wide by your language & region settings. However, you can also set them in your ~/.bash_profile. For example, I use the following settings:

# language settings
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

Restart R/RStudio and everything should work.

like image 97
pat-s Avatar answered Oct 18 '22 20:10

pat-s