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)