plot_ly 在 Shiny 应用程序中不显示图表

RMt*_*eam 1 shiny plotly

我对闪亮的应用程序有疑问。我的闪亮应用程序不\xc2\xb4t 显示图表。我有这个代码。我在 rstudio 查看器中看到的,在闪亮的环境中看不到我的图表。

\n\n
## app.R ##\n\n    library("shiny")\n\nsetwd(\'C:/work\')\n\n\n\n\nui <- dashboardPage(\n  dashboardHeader(title = "Basic dashboard"),\n  dashboardSidebar(),\n  dashboardBody(\n\n    fluidRow(\n      plotOutput("plot", height = 250)),\n      box(\n        title = "Controls",\n        selectInput("select",label="Select",\n                    choices=setNames(as.list(data$prov), data$prov))\n      )\n    )\n  )\n\nserver <- function(input, output){\n\n  output$plot<- renderPlot({\n    plot_ly(bbdd,x=~prov, y=~number, type=\'bar\')\n\n  })\n}\n\n\n\nshinyApp(ui, server)\n
Run Code Online (Sandbox Code Playgroud)\n\n

这是我的第一个闪亮应用程序,别杀我!

\n\n

谢谢

\n

Sem*_*ant 5

将plotOutput 和renderPlot 分别更改为plot ly Output 和renderPlot ly。您还需要加载绘图包和绘图数据。