1.2 Creating an app

Simplest way - create new directory for your app and add a single app.r file

library(shiny)
ui <- fluidPage(
  "Hello, world!"
)
server <- function(input, output, session) {
}
shinyApp(ui, server)

Looking closely at the code above, this app.r file does four things:

  1. Loads shiny
  2. Defines the ui - the HTML webpage humans interact with
  3. Specifies behaviour of the app in the server
  4. Executes shinyApp(ui, server) to construct and start the app