在侧边栏包括闪亮的选项卡面板

Phi*_*ipp 6 tabs r sidebar panel shiny

我正在使用闪亮的包来创建一个应用程序。我想在我的 sidebarPanel 中包含一个选项卡集面板,就像 tabsetPanel() 为用户界面中的 mainPanel() 所做的那样。有谁知道这是否或如何工作?

提前致谢!

ags*_*udy 5

mainPanel或者sidebarPanel只是div标签的包装,一种 html 容器,您可以在其中放置任何其他 html 有效元素。

例如,您可以这样做:

library(shiny)
ui <- pageWithSidebar(
  # Application title
  headerPanel("Hello Shiny!"),
  # Sidebar with a slider input
  sidebarPanel(
    tabsetPanel(
      tabPanel("Plot", plotOutput("plot")),
      tabPanel("Summary", verbatimTextOutput("summary")),
      tabPanel("Table", tableOutput("table"))
    )),
  # Show a plot of the generated distribution
  mainPanel(
    plotOutput("distPlot")
  )
)

server <- function(input,output){}

runApp(list(ui=ui,server=server))
Run Code Online (Sandbox Code Playgroud)