我有一个tabsetPanel()
,我试图隐藏一个tabPanel()
如果选择是两个,checkbox
打开。我尝试了下面的代码来做到这一点,但它不起作用。隐藏闪亮的任何tabpanel
UI
shinyUI(
fluidPage(
titlePanel("Hello Shiny!"),
sidebarLayout(
sidebarPanel(
fluidRow(
column(5,
radioButtons("radio", label = h5("Data uploaded"),
choices = list("Aff" = 1, "Cod" = 2,
"Ill" = 3),selected = 1)
)),
checkboxInput("checkbox", "cheb", value = F)
),
mainPanel(
tabsetPanel(
tabPanel("Plot", "plot1"),
conditionalPanel(
condition = "input.radio !=2 && input.checkbox == false",
tabPanel("Summary", "summary1")
),
tabPanel("Table", "table1")
)
)
)
)
)
服务器
shinyServer(function(input,output,session){
})
我怎么能隐藏tabPanel()
?
隐藏或显示是否满足以下条件:''input.radio == 2 && input.checkbox == true“'。该描述不符合我认为的代码:) – BigDataScientist
你可以做一些像[this](https://groups.google.com/d/msg/shiny-discuss/Coe8drGPJbU/5JXdisgVFAAJ) – SBista
:)只是想补充一点作为另一种选择,因为sthg更接近'conditionalPanel()'。好主意。 – BigDataScientist