Widgets
-
Go to
projects/project1-uiand take a look atUI_starting.RandKnight_bus.R. -
Run
app.R. -
Widgets are the different buttons and fields we see on a webpage.
-
We only see the inputs from
UI_starting.Rbecause nothing is connected to the outputs.
Input Widgets
The Shiny Widget Gallery
-
You can try out and play with Shiny input widgets on RStudio’s website.
-
The website shows you how the values change when you modify the input widgets. The site will also show you the code you need to include the widget in your own app.
https://shiny.rstudio.com/gallery/widget-gallery.html
Output Widgets
-
Output widgets are similar to input widgets. However, output widgets require a
renderfunction to be visible in the app. -
Each output widget has its own corresponding
renderfunction.
Playing with Widgets
Add some input widgets to UI_starting.R
-
actionLink
-
checkboxInput
-
radioButtons
-
textInput
Make sure the app still works with your changes!
Connecting Inputs to Outputs
Add some reactive logic to Knight_bus.R so that the text output felix (output$felix) displays the selected choice from annie (input$annie)