Windows上{RS}上的不可读消息

时间:2015-07-23 10:53:49

标签: r windows character-encoding rstudio

我使用RStudio作为R的前端。它在GNU / Linux上完美运行(即使使用俄语语言环境和俄语消息)。 Hoewever,在Windows上它工作得更糟。 问题出在消息的字体或字符集上。

我安装了RStudio版本0.99.467(AMD64)和R版本3.2.1(2015-06-18)。

我在开头看到以下提示(没有问题,locale是en_US,英语):

R version 3.2.1 (2015-06-18) -- "World-Famous Astronaut"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

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.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

但是当我尝试做错事时,假设尝试加载未安装的软件包,我看到了不可读的错误消息。

> library(abcdef)
Error in library(abcdef) : íåò ïàêåòà ïîä íàçâàíèåì ‘abcdef’

如何使其可读?

顺便说一下,这个问题在RStudio中只显示 。 RGui工作正常(即使是俄语信息,也没有可疑信件):

> library(abcdef)
Ошибка в library(abcdef) :нет пакета под названием ‘abcdef’

(未安装包“abcdef”)。

不知道从哪里开始挖掘。它甚至可以解决吗?或者它是RStudio中的错误?

1 个答案:

答案 0 :(得分:2)

我认为问题是你的系统上没有非Unicode俄语字符集(1251)。

确保在控制面板中将区域设置设置为俄语>区域>行政>更改系统区域设置,然后重新启动系统并检查问题是否仍然存在。

或者您可以将R语言中的language = EN添加到R RConsole目录中的\etc\文件中,将R语言切换为英语。