【问题标题】:Error in shinyApp(ui, server) : `server` missing from shinyAppshinyApp(ui,服务器)中的错误:shinyApp 中缺少“服务器”
【发布时间】:2019-02-07 11:56:43
【问题描述】:

我有以下代码:

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 中的“今天的工作”文本使用普通大小写字母,而不是粗体字母。

【问题讨论】:

  • 您是否尝试在第一个信息框之后添加“,”?含义infoBox("123", "Today's work", "Lots of pending", width = 6), ....
  • 是的,修复缺少的逗号,,并使用server &lt;- shinyServer(function(input, output, session))
  • 是的,我也试过了

标签: r shiny


【解决方案1】:

这应该解决它:

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)

结果:

【讨论】:

  • 谢谢。我们可以将文本“今天的工作”从粗体格式转换为普通格式吗?
猜你喜欢
  • 2020-09-03
  • 1970-01-01
  • 1970-01-01
  • 2018-10-25
  • 1970-01-01
  • 1970-01-01
  • 2021-11-10
  • 2014-03-23
  • 2011-01-11
相关资源
最近更新 更多