r - 当我有选择 > 1000 时,Shiny 不会向我显示整个 selectInput
问题描述
我写了一个简单的例子来说明我在做什么。我想在 selectInput 中显示 3000 个数字。这些数字必须在反应函数中,因为在我的原始工作中,数据来自文件。
我的问题是,当我运行应用程序时,它只显示 1000 个数字,而不是整个数据(3000 个数字)。
我已经看到这篇文章用> 1000个选项更新服务器端选择输入的选择失败,但我不知道如何使用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)
解决方案
与参数一起使用selectizeInput
而不是。selectInput
options = list(maxOptions = 3000)
推荐阅读
- mongodb - 'MongoNetworkError' 'TransientTransactionError' ] unable to run the code
- powershell - 使用 csv 在带有 powershell 的 office 365 中分配许可证
- c - 取消引用“for”循环初始化程序中的指针会导致分段错误
- html - css trick disable text selection on copy-paste
- authentication - Camel sftp - jsch 身份验证失败
- javascript - 多个命名路由器出口 - 组件已导入但未初始化和渲染
- asp.net - AddToRoleAsync() freezes IIS(?) on Chrome
- bash - 重定向标准错误并保留标准输出
- vue.js - Vuejs build/render component inside a method and output into template
- r - 如何根据以某个前缀开头的一列名称值将数据框拆分为不同的数据框?