[英]how to fix special foreign characters in RStudio message (encoding)
I'm using R 3.2.2 and RStudio in Win 7. I installed Asian characters, but the default encode in most part of my computer should be UTF-8 (I don't know how to check this in RStudio). 我在Win 7中使用R 3.2.2和RStudio。我安装了亚洲字符,但计算机大部分部分的默认编码应为UTF-8(我不知道如何在RStudio中进行检查)。
The messages of RStudio often has special characters RStudio的消息通常带有特殊字符
> library(ggmap)
Loading required package: ggplot2
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called 慠cpp?Error: package 慻gplot2?could not be loaded
How should I make this display correctly? 我应该如何正确显示此显示? Can somebody help please.
请有人帮忙。 Thanks!
谢谢!
It seems this is because RStudio is not a complete unicode program. 看来这是因为RStudio不是完整的unicode程序。 Just found the solution here: http://daneix.blogspot.com/2014/08/r-studio-console.html
刚刚在这里找到解决方案: http : //daneix.blogspot.com/2014/08/r-studio-console.html
Briefly, run the following code every time you start up RStudio: 简要地说,每次启动RStudio时运行以下代码:
Sys.setlocale("LC_ALL","Chinese")
Also you can construct a .Rprofile in the default working directory of RStudio (you can find it in RStudio -> Global Options -> General), then it will be called automatically when starting up RStudio. 您也可以在RStudio的默认工作目录中构建.Rprofile(可以在RStudio->全局选项->常规中找到它),然后在启动RStudio时会自动调用它。
However, the disadvantage is that some output of R will be displayed in Chinese. 但是,缺点是R的某些输出将以中文显示。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.