2017-05-30 133 views
2

遇到了這個看似很新的軟件包 - skimr,它看起來非常漂亮,並且正在嘗試它,看起來我缺少一些軟件包安裝。 Skim工作正常,但它不打印直方圖,它應該打印爲數字變量。我只是在嘗試文檔中給出的例子。Skimr - 似乎不能產生直方圖

鏈接到這裏skimr文檔 - https://github.com/ropenscilabs/skimr#skimr

這是我使用

devtools::install_github("hadley/colformat") 
    devtools::install_github("ropenscilabs/skimr") 
    library(skimr) 
    a<-skim(mtcars) 
    dim(a) 
    View(a) 

,而不是印刷直方圖的代碼,我看到一些ASCII/Unicode字符enter image description here

+4

看起來像是一個在Windows下無法正常工作的軟件包中的錯誤:https://github.com/ropenscilabs/skimr/issues/54 – Marius

回答

4

可用於要解決上述問題的解決方案是將R系統的區域設置爲Chinese和R控制檯的字體設置爲NSimSun

temp <- tempfile() 
cat("font = NSimSun\n", file = temp, append = TRUE) 
loadRconsole(file = temp) 
Sys.setlocale(locale='Chinese') 

library(skimr) 
(a <- skim(mtcars)) 

enter image description here

View(a) 

enter image description here

在RStudio此解決方案僅部分。通過skim生成的直方圖可以R的區域設置爲Chinese

Sys.setlocale(locale='Chinese') 
library(skimr) 
a <- skim(mtcars) 
View(a) 

enter image description here

希望這可以幫助你後才使用View可視化。

+1

您能否提供更改語言的潛在副作用? –