闪亮的应用程序:ggplot()显示在RStudio Viewer中,而不是我的主面板

时间:2018-03-28 18:08:55

标签: r ggplot2 shiny

我已经写了一个闪亮的应用程序,它可以正常运行而没有错误,但每次运行程序时,ggplot()都会在RStudio的查看器面板中绘制,但我希望它能够显示在主面板。如何在我的闪亮应用程序的主面板中切换和绘图?

在我的代码中,我的mainPanel不在我的sidebarPanel中,我的plotOutput被正确调用。

mainPanel(plotOutput("plot1"))

这是服务器对plot1的调用。我的所有数据框操作和ggplot()代码都在data1()

之内
output$plot1 <- renderPlot({data1()})  

1 个答案:

答案 0 :(得分:0)

而不是

plotOutput() and renderPlot()

使用:

ggiraphOutput() and renderggiraph()