我正在开发一个我使用的闪亮应用程序tabsetPanel,它是在用户输入某些特定输入时生成的.因此,我想使用renderUI函数使tabsetPanel出现/消失.
我现在的奋斗是,元素的数量 tabPanel(参数tabsetPanel)也取决于用户输入,顺便说一下:有时我需要1个,有时我需要更多tabPanels.
怎么做?我尝试在论证中包含conditionPanel或包含简单if()...条件tabsetPanel,但它(并不奇怪......)不起作用.
我想为不同的标签显示不同的输入.所以我尝试构建一个包含多个tabPanel的页面.但是,我不能像下面这样:
library(shiny)
shinyUI(pageWithSidebar(
headerPanel("Header"),
tabsetPanel(
tabPanel(
headerPanel("Tab 1"),
sidebarPanel(
selectInput("var", "Parametre", choices = c("1", "2", "3"))
),
mainPanel(
textOutput("text1")
)
),
tabPanel(
headerPanel("Tab 2"),
sidebarPanel(
selectInput("var", "Parametre", choices = c("21", "22", "23"))
),
mainPanel(
textOutput("text2")
)
)
)
))
Run Code Online (Sandbox Code Playgroud)
我怀疑这pageWithSidebar是导致问题的原因,但我无法在Google群组中找到替代方案.有没有办法用自己的侧边栏和主面板显示多个标签,还是应该为此创建不同的应用程序?