New to Shiny and can't seem to find this inforamtion yet: I am making an app with two selectInput
drop-downs such that the second (highlighted in yellow) is dependant on the first.
This is for data exploration and basically goes through different folder contents. Here's what I would like to have:
ui <- fluidPage(
selectInput(inputId = "site", label = "Select Site", choices = dir(basepath)),
selectInput(inputId = "duct", label = "Select Duct",
choices = dir(grep(input$site, dir(basepath, full.names = T), val = T)))
)
The above code does not work, clearly. I am not sure how to use input$site
in another input function.
I found some answers: Displaying multiple inputbox on selecting multiple variables using selectinput function in R Shiny and using conditionalPanel in Shiny ui.R and server.R: different selectInput based on a condition but they are not directly applicable since I don't have an exhaustive list of possible options for the first input (inputId = "site"
).