如何设置在启动 Shiny 应用程序时显示哪个 tabPanel?

How to set which tabPanel to show when launching a Shiny app?

当我 运行 应用程序时,我希望 tab 2 被点击,所以我可以先看到它,而不是 tab 1。我该怎么做?

# USER INTERFACE 
ui <-  fluidPage(
  mainPanel(
    tabsetPanel(
      tabPanel("tab 1"),
      tabPanel("tab 2"),
    )
  )
)
# SERVER 
server <- function(input, output) {
  
}
shinyApp(ui = ui, server = server)

尝试:

tabSetPanel(tabPanel("tab1"), tabPanel("tab2"), selected="tab2")