In a shiny app I need to create a "select list input control" (selectInput) whose choices come from a postgresql table with 25473 rows.
I set the connection to postgres with RPostgresql, create a new dataframe using dbGetQuery, with two columns.
Then I create a suitable list (for the "choices" parameter) with the code:
X2 <- list(X[2,1])
for (i in 2:length(X[,2])) {
X[i] <- X[i,1]
}
which takes its time...
The app takes ages to load in a browser and doesn't even load all values in the app viewer (in RStudio).
Is there any more efficient way of doing this?
Thanks in advance,
António