Create a select list input control
Create a select list that can be used to choose a single or multiple items from a list of values.
selectInput(inputId, label, choices, selected = NULL, multiple = FALSE, selectize = TRUE)
selectizeInput(inputId, ..., options = NULL)
- Input variable to assign the control's value to
- Display label for the control
- List of values to select from. If elements of the list are named then that name rather than the value is displayed to the user.
- The initially selected value (or multiple
multiple = TRUE). If not specified then defaults to the first value for single-select lists and no values for multiple select lists.
- Is selection of multiple items allowed?
- Whether to use
- Arguments passed to
- A list of options. See the documentation
selectize.jsfor possible options (character option values inside
- A select list control that can be added to a UI definition.
The selectize input created from
deletion of the selected option even in a single select input, which will
return an empty string as its value. This is the default behavior of
selectInput(..., selectize = TRUE) will ignore the empty string
value when it is a single choice input and the empty string is not in the
choices argument. This is to keep compatibility with
selectInput(..., selectize = FALSE).
selectInput("variable", "Variable:", c("Cylinders" = "cyl", "Transmission" = "am", "Gears" = "gear"))