gpt4 book ai didi

R Shiny Dashboard - 相当于navbarPage?

转载 作者:行者123 更新时间:2023-12-05 07:50:28 25 4
gpt4 key购买 nike

我在 R 中制作了一个 shinydashboard 来显示我的所有数据,看起来比标准的 shiny 更好。

试图弄清楚如何在仪表板中执行与“navbarPage”等效的操作(即有多个页面显示不同的数据,而不是将所有数据放在同一页面的不同框中)。

我试着简单地在代码中添加“navbarPage(”,但这会出现多个错误)

最佳答案

shiny dashboard 入门页面的示例回答了您的问题。为了您的方便,它就在这里。

    body <- dashboardBody(
fluidRow(
tabBox(
title = "First tabBox",
# The id lets us use input$tabset1 on the server to find the current tab
id = "tabset1", height = "250px",
tabPanel("Tab1", "First tab content"),
tabPanel("Tab2", "Tab content 2")
),
tabBox(
side = "right", height = "250px",
selected = "Tab3",
tabPanel("Tab1", "Tab content 1"),
tabPanel("Tab2", "Tab content 2"),
tabPanel("Tab3", "Note that when side=right, the tab order is reversed.")
)
),
fluidRow(
tabBox(
# Title can include an icon
title = tagList(shiny::icon("gear"), "tabBox status"),
tabPanel("Tab1",
"Currently selected tab from first box:",
verbatimTextOutput("tabset1Selected")
),
tabPanel("Tab2", "Tab content 2")
)
)
)

shinyApp(
ui = dashboardPage(
dashboardHeader(title = "tabBoxes"),
dashboardSidebar(),
body
),
server = function(input, output) {
# The currently selected tab from the first box
output$tabset1Selected <- renderText({
input$tabset1
})
}
)

关于R Shiny Dashboard - 相当于navbarPage?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36081890/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com