2017-05-30 68 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

您能否提供更改语言的潜在副作用? –