user2983123
user2983123

Reputation: 75

Shiny updateRadioButtons

I'd like to use upateRadioButtons in order to clear all the RadioButtons input selections. My shiny app uses several RadioButtons as input, but only the first one is cleared when using updateRadioButtons. All other RadioButtons remain at their last selection.

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)
}

Upvotes: 0

Views: 256

Answers (1)

user2983123
user2983123

Reputation: 75

I found the following solution: replacing

selected = character(0)

by

selected = ""

does the trick.

Upvotes: 2

Related Questions