checkboxGroupInput {shiny} | R Documentation |
Create a group of checkboxes that can be used to toggle multiple choices independently. The server will receive the input as a character vector of the selected values.
checkboxGroupInput(inputId, label, choices, selected = NULL, inline = FALSE, width = NULL)
inputId |
The |
label |
Display label for the control, or |
choices |
List of values to show checkboxes for. If elements of the list are named then that name rather than the value is displayed to the user. |
selected |
The values that should be initially selected, if any. |
inline |
If |
width |
The width of the input, e.g. |
A list of HTML elements that can be added to a UI definition.
checkboxInput
, updateCheckboxGroupInput
Other input.elements: actionButton
,
checkboxInput
, dateInput
,
dateRangeInput
, fileInput
,
numericInput
, passwordInput
,
radioButtons
, selectInput
,
sliderInput
, submitButton
,
textAreaInput
, textInput
## Only run examples in interactive R sessions if (interactive()) { ui <- fluidPage( checkboxGroupInput("variable", "Variables to show:", c("Cylinders" = "cyl", "Transmission" = "am", "Gears" = "gear")), tableOutput("data") ) server <- function(input, output) { output$data <- renderTable({ mtcars[, c("mpg", input$variable), drop = FALSE] }, rownames = TRUE) } shinyApp(ui, server) }