我想使用upateRadioButtons来清除所有RadioButtons输入选择。我的闪亮应用程序使用几个RadioButtons作为输入,但只有第一个使用updateRadioButtons时被清除。所有其他RadioButtons仍然是他们的最后选择。
UpdateInputs <- function(data, session) {
updateRadioButtons(session, "var1",
choices = list("zero" = 0, "one" = 1, "two" = 2, "three" = 3, "four" = 4),
selected = character(0), inline=T)
updateRadioButtons(session, "var2",
choices = list("zero" = 0, "one" = 1, "two" = 2, "three" = 3, "four" = 4,
selected = character(0), inline=T)
}
答案 0 :(得分:2)
我找到了以下解决方案: 替换
selected = character(0)
通过
selected = ""
诀窍。