The ui.R file is a description of the UI, and is often the shortest and simplest part of a Shiny application. In the following code, note the use of the # character, which marks lines of code as comments that will not be run, but which are for the benefit of the humans producing the code:
fluidPage( # Line 1 titlePanel("Minimal application"), # Line 2 sidebarLayout( # Line 3 sidebarPanel( # Line 4 textInput(inputId = "comment", # Line 5 label = "Say something?", # Line 6 value = "" # Line 7 )), # Line 8 mainPanel( # Line 9 h3("This is you saying it"), # Line 10 textOutput("textDisplay") # Line 11 ) ) )
The following list is an explanation of each line:
- Line 1: Flexible layout function
- Line 2: Title
- Line 3 ...