如何产生闪亮的输出

时间:2016-04-04 03:53:40

标签: r shiny

这是我的数据:

  NASIDENTIFIER TERMINATECAUSE   avg_dur  avg_input avg_output total
         (fctr)         (fctr)     (dbl)      (dbl)      (dbl) (int)
1       BSRAS01   Lost-Carrier  37221.89   61267475  846641401    87
2       BSRAS01    NAS-Request 259205.00 2011644584 3118623049     1
3       BSRAS01   User-Request  12329.50   38958653  461478822    60
4       BSRAS51    Admin-Reset 206589.99  589002948 5989044994   140
5       BSRAS51   Lost-Carrier  36059.12  157811318 1837199576 33990
6       BSRAS51    NAS-Request 259209.07  267715474 3123280566    28

如何根据nasidentifier的每一个生成带有x(terminatecause)和y(总数)的图?

这是我的代码:

library(shiny)

#UI.R
ui <- shinyUI(pageWithSidebar(

  headerPanel("Testing"),

  sidebarPanel(
    selectInput("nas", "Your NAS-Identifier",levels(NASIDENTIFIER))),

  mainPanel(

    plotOutput("nasplot")
  )
))

#SERVER.R
server <- shinyServer(function(input, output) {

  output$nasplot<- renderPlot({
    plot(q$TERMINATECAUSE,q$total)
  })
})

# Run the application 
shinyApp(ui = ui, server = server)

0 个答案:

没有答案