【问题标题】:R - Could not find function "dashboardPagePlus"R - 找不到函数“dashboardPagePlus”
【发布时间】:2021-06-02 16:51:51
【问题描述】:

我尝试使用dashboardPagePlus 创建一个闪亮的应用程序。

我已经导入了 shinydashboard 和 shinydashboardPlus 包。但是我在运行 UI 时收到一条错误消息。

dashboardPagePlus(skin = "black", dashboardHeaderPlus(title = "title"), : 找不到函数 "dashboardPagePlus"

我不知道为什么。我尝试从 RDocumentation 运行示例代码。但是还是有这个问题。

示例代码:

library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
shinyApp(
  ui = dashboardPagePlus(
    header = dashboardHeaderPlus(
      enable_rightsidebar = TRUE,
      rightSidebarIcon = "gears"
    ),
    sidebar = dashboardSidebar(),
    body = dashboardBody(),
    rightsidebar = rightSidebar(),
    title = "DashboardPage"
  ),
  server = function(input, output) { }
)

如何解决? 非常感谢。

【问题讨论】:

标签: r shiny shinydashboard


【解决方案1】:

正如 cmets 中已经提到的,如果您使用 {shinydashboardPlus} >= 2.0.0,您需要重写代码如下:

library(shiny)
library(shinydashboard)
library(shinydashboardPlus)

shinyApp(
  ui = dashboardPage(
    header = dashboardHeader(),
    sidebar = dashboardSidebar(),
    body = dashboardBody(),
    controlbar = dashboardControlbar(
      skin = "dark",
      controlbarMenu(
        id = "menu"
      )
    ),
    title = "DashboardPage"
  ),
  server = function(input, output) { }
)

【讨论】:

  • 感谢您的帮助。我知道原因。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-05-16
  • 2015-11-06
  • 2019-07-08
  • 2018-05-29
  • 2014-04-29
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多