r - Windows 上的 RStudio 上无法读取消息

标签 r windows character-encoding rstudio

我使用 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/

相关文章:

r - 如何使用 R 通过 FTP 推送 .csv 文件?

r - 如何跨 data.frame 列应用函数?

r - 合并具有两个值的两列

c# - 来自 ssh 远程文本文件的多行文本框

php - 编码数据库和服务器

R代码为 'tidy'离散变量的值

sql - 查询Windows版本

c# - 每次在我的 Windows PC 上关闭 Visual Studio 时,有没有办法阻止 Docker 删除容器?

php - 如何在PHP中设置文本文件编码?

python - 在 Python 中加载 JSON 作为 header 字符集