假设我有以下代码。。。
用户界面
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来使用条件面板隐藏/显示复选框组?据我所知,actionButton只存储一个从0开始的整数,每次单击按钮时会增加1,这在本例中似乎没有太大帮助。有没有可能有一个条件面板,它只在actionButton值为偶数或类似数字时显示自己?