我有带有“ radioButtons”元素的R Shiny应用,默认选择值为“ 1”。
radioButtons("rbtn_metrics", "Metric",
choices = list("Metric_1" = 1, "Metric_2" = 2, "Metric_3" = 3),
selected = 1)
假设用户选择了第二个元素(2),然后看到“ Metric_2”的数据。然后他进行其他选择,更新UI,并将radioButtons元素默认设置为“ 1”。
在这种情况下,如何将第二个元素(2)保留为默认选定值?
谢谢!