2016-10-28 106 views
1

我在renderPlot部分有一個stange錯誤。這裏是例子(摘自主腳本):renderPlot中的錯誤(閃亮)

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:plotObj
77:origRenderFunc
76:輸出$博沒有電流裝置從
堆棧跟蹤(最內第一)記錄x_plot_abs
1:runApp
從調用:的eval(expr中,ENVIR,enclos)
錯誤gregexpr(calltext,單線,固定= TRUE):
正則表達式無效UTF-8

我發現了一個similar error和解決方案,但不是我的情況下 我會爲你的提示gratefull。

回答

2

看來問題出在dev.off()這一行。一旦你刪除它的作品。

+0

你有什麼想法爲什麼是這樣嗎?早些時候它很好。 –