选择框
创建一个选择列表,可用于从值列表中选择单个或多个项目。
library(shiny)
ui <- fluidPage(    
  selectInput("id_selectInput", 
          label = HTML('<B><FONT size="3">What is your favorite color ?</FONT></B>'), 
          multiple = TRUE,
          choices = list("red" = "red", "green" = "green", "blue" = "blue", "yellow" = "yellow"), 
          selected = NULL),
  br(), br(),
  fluidRow(column(3, textOutput("text_choice")))) 
server <- function(input, output){
  output$text_choice <- renderPrint({
    return(input$id_selectInput)})
}
shinyApp(ui = ui, server = server)

可以更改设置:
- 标签:标题
- 选择:选定的值
- selected:最初选择的值(NULL 表示没有选择)
- 倍数:TRUE 或 FALSE
- 宽度
- 尺寸
- selectize:TRUE 或 FALSE(使用或不使用 selectize.js,更改显示)
也可以添加 HTML。