Skimr-似乎无法生成直方图 [英] Skimr - cant seem to produce the histograms

查看:224
本文介绍了Skimr-似乎无法生成直方图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

遇到了这个看似新的软件包-skimr,它看起来很漂亮,并且正在尝试它,好像我错过了一些软件包安装.略读效果很好,只是它不打印直方图,而应该打印数字变量.我只是尝试文档中给出的示例.

came across this seemingly new package - skimr, which looks pretty nifty, and was trying it out and looks like I'm missing some package installation. Skim works fine except that it doesn't print the histogram, it is supposed to print for numeric variables. I am merely trying the examples given in the documentation.

此处链接到Skimr文档- https://github.com/ropenscilabs/skimr#skimr

Link to skimr documentation here - 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字符.

instead of histograms being printed, I see some ASCII/unicode characters .

推荐答案

可以用于解决上述问题的解决方案是将R系统的语言环境设置为Chinese,并设置R控制台的字体.到NSimSun.

A solution that can be used to workaround the above problem is to set the locale of the R system to Chinese and to set the font of the R console to NSimSun.

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

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

View(a)

在RStudio中,此解决方案仅部分起作用.将R的区域设置设置为Chinese

In RStudio this solution works only partially. Histograms generated by skim can be visualized only using View after setting the locale of R to Chinese

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

希望这可以为您提供帮助.

Hope this can help you.

这篇关于Skimr-似乎无法生成直方图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆