如何在R Shiny应用程序中更改“ radioButtons” UI元素的默认选定值?

时间:2019-02-06 13:34:48

标签: r shiny radio-button

我有带有“ 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)保留为默认选定值?

谢谢!

0 个答案:

没有答案