Hi all,
I'm currently working on a shiny app that requires somewhat dynamic inputs. Ideally, I want a situation where, using the list in the shiny app below, the user first selects a game (Mario, Zelda, or Starfox) using a selectInput()
, once selecting the game they can complete another selectInput()
on individuals from that specific game (had they chosen Mario, there is now a selectInput()
including Mario, Peach, Luigi, and Bowser).
To better illustrate what I want I adapted the code below from here. However the difference I want is instead of one selectInput()
that includes all character options I want two one for games, one for characters. The amount of character and games that the shiny app will actually require will be far too much for a single select input to handle gracefully.
shinyApp(
ui = fluidPage(
selectInput("game", "Choose a character:",
list(Mario = c("Mario", "Peach", "Luigi", "Bowser"),
`Legend of Zelda` = c("Link","Zelda", "Ganondorf", "Navi"),
Starfox = c("Fox", "Falco", "Wolf", "Slippi"))),
textOutput("result")
),
server = function(input, output) {
output$result <- renderText({
paste("You chose", input$game)
})
}
)
I'm sorry if this question has already been asked, the way I worded it did not return any similar questions.
Best regards,
Tim N