App 1: Multilingual Greeting
Congratulations! You are now ready to start building your own apps. The best way to learn Shiny is by deconstructing an existing app and rebuilding it from scratch.
In this exercise, you are going to build a Shiny app that allows you to enter your name and select a greeting (Hello/Bonjour), and returns "Hello, Kaelen", when the user is Kaelen. Admittedly, it is a really simple app, but the challenge is you are going to have to code it from scratch! Good luck!!
We have already loaded the shiny
package for you. Recall that the four steps to building a Shiny app are: (1) Add inputs, (2) Add outputs, (3) Update layout, and (4) Update outputs.
This exercise is part of the course
Building Web Applications with Shiny in R
Exercise instructions
- Add an input to select between greeting types "Hello" and "Bonjour".
- Add an input to enter name as text.
- Your app should print "Bonjour, Kaelen" if the selected greeting type is "Bonjour" and the name entered is "Kaelen".
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
ui <- fluidPage(
)
server <- function(input, output, session) {
}
shinyApp(ui = ui, server = server)