
Then, we define the user interface by calling the function pageWithSidebar: # Define UI for miles per gallon app - ui library (shiny ) > runApp ( "~/shinyapp" )Īlternatively, if you are working on you can click the Run App button on your RStudio Editor. Now we’ll add the minimal code required in the source file called app.R.įirst, we load the shiny package: library ( shiny ) ui For purposes of illustration we’ll assume you’ve chosen to create the application at ~/shinyapp: ~/shinyapp To get started building the application, create a new empty directory wherever you’d like, then create an empty app.R file within it. This folder can also contain any any additional data, scripts, or other resources required to support the application. A Shiny application is simply a directory containing an R script called app.R which is made up of a user interface object and a server function.

Let’s walk through the steps of building a simple Shiny application.
