R Shiny selectInput that is dependent on another selectInput

后端 未结 2 2023
天命终不由人
天命终不由人 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 09:44

    You can't access inputs in the ui.R part of the app so you need to use renderUi/uiOutput to dynamically generate your selectInput.

    In your ui.R you could add:

    uiOutput("secondSelection")
    

    and in your server.R:

     output$secondSelection <- renderUI({
                    selectInput("User", "Date:", choices = as.character(dat5[dat5$email==input$Select,"date"]))
            })
    

提交回复
热议问题