说我有以下代码......
用户界面
library(shiny)
ui <- fluidPage(
actionButton("fishButton", label = "Fish"),
checkboxGroupInput("Check1",label=h4 ("Fish:"), choices = c("Bass","Shark","Tuna")),
actionButton("reptileButton", label = "Reptile"),
checkboxGroupInput("Check2",label=h4 ("Reptile:"), choices = c("Komodo","Skink","Snake")),
actionButton("mammalButton", label = "Mammal"),
checkboxGroupInput("Check3",label=h4 ("Mammals:"), choices = c("Dog","Cat","Bear")),
actionButton("birdButton", label = "Bird"),
checkboxGroupInput("Check4",label=h4 ("Birds:"), choices = c("Budgie","Parrot","Cockatiel")),
actionButton("amphibianButton", label = "Amphibian"),
checkboxGroupInput("Check5",label=h4 ("Amphibian:"), choices = c("Frog","Toad","Salamander"))
)
有没有办法使用条件面板通过单击适当的 actionButton 来隐藏/显示 checkboxGroups?据我了解,actionButton 仅存储一个从 0 开始并随着按钮的每次单击而增加 1 的整数,这在这种情况下似乎没有多大帮助。是否有可能有一个仅在其 actionButton 值为偶数或类似数字时才显示的条件面板?