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:
- Loads
shiny
- Defines the ui - the HTML webpage humans interact with
- Specifies behaviour of the app in the server
- Executes
shinyApp(ui, server)
to construct and start the app