【发布时间】:2021-07-07 13:04:19
【问题描述】:
我写了一个简单的例子来说明我在做什么。我想在 selectInput 中显示 3000 个数字。这些数字必须在反应函数中,因为在我的原始工作中,数据来自文件。
我的问题是,当我运行应用程序时,它只显示 1000 个数字,而不是整个数据(3000 个数字)。
我看过这篇帖子Updating selection of server-side selectize input with >1000 choices fails,但我不知道如何使用 uiOutput 和 renderUI 来做到这一点。
谁能帮帮我?
提前非常感谢
代码:
library(shiny)
ui <- fluidPage(
titlePanel("Numbers"),
sidebarLayout(
sidebarPanel(
uiOutput('selectUI')
),
mainPanel(
)
)
)
server <- function(input, output) {
num <- reactive({
data = c(1:3000)
return(data)
})
output$selectUI <- renderUI({
selectInput(inputId = 'options', "Select one", choices = num())
})
}
# Run the application
shinyApp(ui = ui, server = server)
【问题讨论】: