簡體   English   中英

如何修復RStudio消息中的特殊外來字符(編碼)

[英]how to fix special foreign characters in RStudio message (encoding)

我在Win 7中使用R 3.2.2和RStudio。我安裝了亞洲字符,但計算機大部分部分的默認編碼應為UTF-8(我不知道如何在RStudio中進行檢查)。

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

我應該如何正確顯示此顯示? 請有人幫忙。 謝謝!

看來這是因為RStudio不是完整的unicode程序。 剛剛在這里找到解決方案: http : //daneix.blogspot.com/2014/08/r-studio-console.html

簡要地說,每次啟動RStudio時運行以下代碼:

Sys.setlocale("LC_ALL","Chinese")

您也可以在RStudio的默認工作目錄中構建.Rprofile(可以在RStudio->全局選項->常規中找到它),然后在啟動RStudio時會自動調用它。

但是,缺點是R的某些輸出將以中文顯示。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM