R Shiny selectInput that is dependent on another selectInput

后端 未结 2 2020
天命终不由人
天命终不由人 2021-01-31 09:07

I have some data below that I\'m using to create a donut chart in R shiny, where date is a character. I want to be able to select the email whose score I want to vi

2条回答
  •  被撕碎了的回忆
    2021-01-31 10:03

    You can also do it whout changing ui.R. At least that solution works in an App that I did. Ading this to server.R should have the same effect.

    observe({
          updateSelectInput(session, "User", choices = as.character(dat5[dat5$email==input$Select, date]))
    })
    

    Though it is a useful and powerful too, I find it "cleaner" te get by without renderUI. It keeps the UI in the UI and the server in the server. But that is just a matter of taste, I suppose.

提交回复
热议问题