Changing a Shiny app UI based on user input
Employing tools acquired in the previous recipe, you will be able to go quite far exploring Shiny's possibilities.
However, there is a quite advanced topic that was excluded from the previous recipe: UI customization based on user input.
This is an amazing feature, and it is even more amazing if you think you don't have to learn JavaScript or any other language to apply it to your app. Only R code knowledge is needed. Our app will ask for a first question and consequently change the possible answers to a second question.
One last word; our app will be based on the Lord of the Rings characters. I hope you will appreciate this. Now, let's start without any ado; as Samwise Gamgee would say:
"It's the job that's never started as takes longest to finish."
Getting ready
In order to run our Shiny app, we will need to install and load the shiny
and shinyBS
packages:
Install.packages(c('shiny','shinyBS')) library(shinyBS) library(shiny)
Before looking at the actual...