【发布时间】:2014-01-21 01:31:27
【问题描述】:
我正在使用闪亮的包来创建一个应用程序。我想在我的侧边栏面板中包含一个选项卡集面板,就像 tabsetPanel() 为用户界面中的 mainPanel() 所做的那样。有谁知道这是否或如何工作?
提前致谢!
【问题讨论】:
标签: r tabs panel sidebar shiny
我正在使用闪亮的包来创建一个应用程序。我想在我的侧边栏面板中包含一个选项卡集面板,就像 tabsetPanel() 为用户界面中的 mainPanel() 所做的那样。有谁知道这是否或如何工作?
提前致谢!
【问题讨论】:
标签: r tabs panel sidebar shiny
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))
【讨论】: