基本闪亮不渲染情节

时间:2016-03-07 09:53:32

标签: r plot shiny

我有这个闪亮的代码,情节因某些原因没有显示。你能伸出援助之手吗? 是在主面板中渲染的基本闪亮图。检查负载次数,仍然没有绘图。

library(shiny)
library(plotly)
library(ggplot2)

ui <- fluidPage(
  (titlePanel("APP & MEP | Size (m2) ~ Hours", windowTitle = "app")),

  sidebarLayout( 
    sidebarPanel(
      checkboxGroupInput(inputId = "checkgroup",
                         label = "Select Deparments",
                         choices = c("All", "ELE", "HVAC", "MAN", "PH", "LV"),
                         selected = "All", inline = F),
      radioButtons(inputId = "radio", 
                   label =  "ADD Stat_Smooth?", 
                   choices = c("YES","NO"), 
                   inline = T),
      sliderInput(inputId = "slider",
                  label = "SPAN Setting", 
                  min = 0.2, max = 2, value = 1,
                  ticks = T)
    ),

    mainPanel(plotOutput(outputId = "plot33"))
  )
)


server <- function(input, output){

  output$plot33 <- renderPlotly({

    gg <- ggplot(sizedf, aes(SIZE, Hours)) + geom_point(aes(color = Department)) + ggtitle("Size(m2) vs Hours per department")

    p <- ggplotly(gg)
    p
  })
}

shinyApp(ui = ui, server = server)

1 个答案:

答案 0 :(得分:1)

我已经看过几次同样的错误了。

应该使用

plotlyOutput(),而不是plotOutput()