首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Crash Boruta图

Crash Boruta图
EN

Stack Overflow用户
提问于 2016-07-22 01:51:43
回答 1查看 275关注 0票数 0

我试着运行下一段代码:

代码语言:javascript
复制
doc.plot <- addPlot(doc = doc.plot,
                    fun = function() plot(Boruta.plot,las=2,
                                          xlim = c(55,65)),
                    vector.graphic = TRUE)

但是,Rstudio存在致命错误。xlim = c(55,65)是有问题的代码,因为没有这个零件绘图功能是工作的。ReporteRs版本0.8.6。请帮助修复此错误。

EN

回答 1

Stack Overflow用户

发布于 2016-07-22 18:02:01

代码语言:javascript
复制
# Wrtie example for reporteRs crush
library(Boruta)
library(ReporteRs)

# Create example data
fact <- as.factor(c(rep(x = rbinom(50,1,0.5),2)))
A <- rnorm(length(fact))
B <- rlnorm(length(fact))
C <- as.factor(rbinom(length(fact),size = 20,0.75))
example.data <- data.frame(fact,A,B,C)
example.boruta <- Boruta(fact~., example.data)
plot(example.boruta, las =2)

sessionInfo()
# R version 3.3.1 (2016-06-21)
# Platform: x86_64-w64-mingw32/x64 (64-bit)
# Running under: Windows >= 8 x64 (build 9200)
# 
# locale:
#   [1] LC_COLLATE=Russian_Russia.1251  LC_CTYPE=Russian_Russia.1251    LC_MONETARY=Russian_Russia.1251
# [4] LC_NUMERIC=C                    LC_TIME=Russian_Russia.1251    
# 
# attached base packages:
#   [1] stats     graphics  grDevices utils     datasets  methods   base     
# 
# other attached packages:
#   [1] ReporteRs_0.8.6     ReporteRsjars_0.0.2 Boruta_5.0.0        ranger_0.5.0       
# 
# loaded via a namespace (and not attached):
#   [1] Rcpp_0.12.6       png_0.1-7         digest_0.6.9      mime_0.5          R.methodsS3_1.7.1 R6_2.1.2         
# [7] xtable_1.8-2      gdtools_0.0.7     R.oo_1.20.0       R.utils_2.3.0     xml2_1.0.0        tools_3.3.1      
# [13] shiny_0.13.2      httpuv_1.3.3      htmltools_0.3.5   rJava_0.9-8       rvg_0.1.0         knitr_1.13  

# Save use ReporteRs
doc <- NULL
doc <- docx(title = 'Crash Boruta')
doc <- addParagraph(doc, 'Example')
doc <- addPlot(doc = doc,
               fun = function()
                 plot(example.boruta,
                    las=2,
                    xlim = c(4,6)),
               vector.graphic = TRUE)
writeDoc(doc = doc, 'example crash boruta.docx') # Its worked

doc <- NULL
doc <- docx(title = 'Crash Boruta')
doc <- addParagraph(doc, 'Example')
doc <- addPlot(doc = doc,
               fun = function()
                 plot(example.boruta,
                      las=2,
                      xlim = c(3,6)),
               vector.graphic = TRUE)

            ###
            ###
            ###
          ##   ##
        ##      ##
      ##         ##
      ## he hanged##
      ##  himself ##
       ##       ##
        ##     ##
         ##   ##
          ####
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38511118

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档