我想从将来更新SelectizeInput
,但我收到此错误:
"尝试在NULL"
上设置属性以下是一个例子:
library(shiny)
library(future)
plan(transparent)
ui <- fluidPage(# client side selectize
selectizeInput("currentCountry", "Countries : ", choices = NULL))
server <- function(input, output, session) {
repeat {
countriesFuture <- future({
rtweet::stream_tweets(timeout = 20)
})
updateCountries <- future({
worldTweets<- value(countriesFuture)
updateSelectizeInput("currentCountry",
"New Countries : ",
choices = worldTweets$country)
})
}
}
shinyApp(ui, server)
答案 0 :(得分:0)
我猜您需要将会话添加到updateSelectizeInput
,所以它变为如下:
updateSelectizeInput(session, "currentCountry", choices = worldTweets$country)