【发布时间】:2017-03-15 15:57:37
【问题描述】:
如何观察在shiny中取消选择selectInput的所有元素?
例如
library(shiny)
ui=shinyUI(fluidPage(
selectInput("select","",choices = c(1,2),multiple = T)
))
server=function(input, output,session) {
observeEvent(input$select,{
print(input$select)
})
}
shinyApp(ui,server)
行动:
1) 选择 1
2) 选择 2
3) 取消选择 2
4) 取消选择 1
控制台日志:
[1] "1"
[1] "1" "2"
[1] "1"
所以全部取消选择时没有打印。
这是错误还是我做错了什么?
【问题讨论】: