Allow for several selection in radiobuttons in rshiny

Viewed 21

I want the user to be able to select some of the factors of a given column.

For this, I create a radioButton option that has the factors as option selection, however, I didn't find a way of doing two things:

  • Allow for multiple selection at the same time.
  • Start the display with all the factors selected.
output$select_fact <- renderUI({
    e <- unique(data_input()[[input$num_var_1]])
    prettyRadioButtons("select_fact", "Choose factors", choices = e)
})
1 Answers

Im pretty sure the multiple selection isnt avaibale for RadioButtons. A similar alternative would be the checkboxGroupButtons.

Try this and look for the checkboxGroupButtons documentation for better configuration.

 checkboxGroupButtons(
            inputId = "select_fact", 
            label = "Choose factors", 
            choices = e, 
            direction = "vertical")
Related