我使用 RStudio 作为 R 的前端。它在 GNU/Linux 上完美运行(即使使用俄语语言环境和俄语消息)。然而,在 Windows 上它的效果更差。 问题出在消息的字体或字符集上。
我安装了 RStudio 版本 0.99.467 (AMD64) 和 R 版本 3.2.1 (2015-06-18)。
我在开头看到以下提示(没有问题,区域设置是 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 中的一个错误?
最佳答案
我认为问题在于您的系统上没有非 Unicode 俄语字符集 (1251)。
确保在控制面板 > 区域 > 管理 > 更改系统区域设置中将区域设置设置为俄语,然后重新启动系统并检查问题是否仍然存在。
或者您可以通过将 language = EN
添加到 R 的 \etc\
目录中的 RConsole
文件(默认为 C:\Program Files\R\R-x.x.x\etc\
)。
关于r - Windows 上的 RStudio 上无法读取消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31585287/