The first thing to note is that Shiny programs are the easiest to build and understand using two scripts, which are kept within the same folder. They should be named server.R and ui.R.
A minimal example of a full Shiny application
The ui.R of the minimal example
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...