R控制台使用我的母语,如何将R设置为英语? [英] The R console is in my native language, how can I set R to English?

查看:103
本文介绍了R控制台使用我的母语,如何将R设置为英语?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7上使用R.显然,R以某种方式找到了我说英语以外的语言的证据,并且顽固地坚持使用我自己的语言在控制台中提供输出.由于种种原因,这是不可取的,我希望R为英语.

什么有效

我可以使用LANGUAGE=en作为R控制台桌面快捷方式的命令行选项,但是Rstudio中的语言仍然错误,它直接启动R可执行文件,因此忽略了快捷方式中的命令行参数. /p>

什么不起作用

我尝试在C:\Users\[MY_NAME]\Documents下创建一个.Renviron文件,该文件是getwd()为工作目录返回的路径,其中包含LANGUAGE=en. R忽略了这一点.我的R_ENVIRONR_ENVIRON_USER变量显示为"",因此.Renviron应该是正确的文件名.

我也尝试在R_HOME\etc下创建.Renviron(R_HOME指向C:/PROGRA~1/R/R-215~1.0),R也忽略了它.

我在R_HOME\etc中添加Sys.setenv(LANGUAGE="en")取得了一些成功-除了初始版权信息外,这使R控制台的所有输出都变为英语.

问题

如何将R默认设置为英语,以便将其传播到RStudio?

解决方案

在全新安装中,将language = en添加到Rconsole文件(默认情况下在R_HOME\etc下存在)将使R的语言为R控制台以及RStudio.可以通过工作目录中的代码以及RStudio的各个项目来覆盖.

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.

这篇关于R控制台使用我的母语,如何将R设置为英语?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆