我需要向 Shiny 应用程序添加一个 textInput,该应用程序的工作与 this 文本框 的工作类似。它需要填充一长串位置/坐标,并能够根据用户输入的内容预测位置的名称。理想情况下,它也会显示滚动条。
selectInput(inputId = 'locations_coords,label = 'Coordinates',choices = c("John Doe","Ash","Ajay sharma","Ken Chong","Will Smith","Neo"),selected = NULL,multiple = F)
您可以使用
selectizeInput
并激活其“创建”选项:
library(shiny)
ui <- fluidPage(
selectizeInput(inputId = "test",
label = "Test",
choices = month.name,
options = list(create = TRUE,
createOnBlur = TRUE)
)
)
server <- function(input, output, session) {}
shinyApp(ui, server)