【问题标题】:Error in renderPlot (shiny)renderPlot 中的错误(闪亮)
【发布时间】:2016-10-28 13:24:12
【问题描述】:

我在 renderPlot 部分有一个 stange 错误。这是示例(从主脚本中提取):

ui.R

 splitLayout(cellWidths = 600, plotOutput("box_plot_best", width = "80%", height = "200px"))

server.r

output$box_plot_best <- renderPlot({

          boxplot(c(1:100), width=4, horizontal= TRUE, staplewex = 1, axes=FALSE, main=("Theoretical boxplot"))     
          abline(v = mean(c(1:100)), col = "red") 
          dev.off()

        })

之前一切正常 - 生成了箱线图。 但是现在产生了一个奇怪的错误:

gregexpr 中的错误(calltext,单行,固定 = TRUE):
正则表达式无效 UTF-8
浏览[2]> c
警告:grDevices::recordPlot 中的错误:当前没有可记录的设备
堆栈跟踪(最内层优先):
89:
第78话
77: 原始渲染函数
76: 输出$box_plot_abs
1:运行应用程序
调用自:eval(expr, envir, enclos)
gregexpr 中的错误(calltext,单行,固定 = TRUE):
正则表达式是无效的 UTF-8

我找到了similar error 和解决方案,但不完全是我的情况 我会很感激你的提示。

【问题讨论】:

    标签: r shiny


    【解决方案1】:

    看来问题出在dev.off() 行上。一旦你删除它就可以工作了。

    【讨论】:

      猜你喜欢
      • 2019-05-23
      • 2020-08-28
      • 2021-10-09
      • 1970-01-01
      • 2017-07-17
      • 2015-06-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多