I'm curious what I can do to improve the speed of the following sample code. When myList is a small vector, no problem. When myList is a very large vector, the UI hangs. Reproducible example below, thank you in advance.
ui <- {
fluidPage(
h3('UI Test'),
uiOutput("chooser"),
plotOutput('myPlot')
)
}
server <- function(input, output, session) {
myList <- reactive({
gl(2000, 1)
#gl(200000, 1) vector this size hangs the UI
})
output$chooser <- renderUI({
myList <- myList()
selectizeInput("chooser","Select ID:", myList, multiple=FALSE)
})
output$myPlot <- renderPlot({
pos <- which(myList() == input$chooser)
plot(pos:10000)
})
} # end server
shinyApp(ui, server) #run