ShinyApp(UI,服务器)中的错误:shinyApp中缺少“服务器”

时间:2019-02-07 11:56:43

标签: r shiny

我有以下代码:

library(shinydashboard)
library(shiny)

ui <- shinyUI( dashboardPage(dashboardHeader(title = "example"),
    dashboardSidebar(),
    dashboardBody(h3("text format"),
    mainPanel(
    infoBox("123", "Today's work", "Lots of pending", width = 6)
    infoBox("234", "Today's work", "completed", width = 6)
    ))))
server <- shinyServer({})
shinyApp(ui, server)

有人可以帮助我解决该错误吗? 另外,我希望infoBox中的“今天的工作”文本使用大写字母,而不是大写字母。

1 个答案:

答案 0 :(得分:0)

这应该解决它:

server <- shinyServer(function(input, output){})

这是完整的代码:

library(shinydashboard)
library(shiny)

ui <- shinyUI( dashboardPage(dashboardHeader(title = "example"),
                             dashboardSidebar(),
                             dashboardBody(h3("text format"),
                                           mainPanel(
                                             infoBox("123", "Today's work", "Lots of pending", width = 6),
                                             infoBox("234", "Today's work", "completed", width = 6)
                                           ))))
server <- shinyServer(function(input, output){})
shinyApp(ui, server)

结果: ShinyApp