

Finally the shinyApp function creates Shiny app objects from an explicit UI/server pair. The server function contains the instructions that your computer needs to build your app. The user interface ( ui) object controls the layout and appearance of your app. The script app.R lives in a directory (for example, newdir/) and the app can be run with runApp("newdir"). Shiny apps are contained in a single script called app.R. To run Hello Shiny, type: library ( shiny ) runExample ( "01_hello" ) Structure of a Shiny App You’ll use Hello Shiny to explore the structure of a Shiny app and to create your first app. Users can change the number of bins with a slider bar, and the app will immediately respond to their input. The Hello Shiny example plots a histogram of R’s faithful dataset with a configurable number of bins. Each example is a self-contained Shiny app. The Shiny package has eleven built-in examples that each demonstrate how Shiny works.

If you still haven’t installed the Shiny package, open an R session, connect to the internet, and run install.packages ( "shiny" ) Examples This lesson will get you started building Shiny apps right away. Shiny is an R package that makes it easy to build interactive web applications (apps) straight from R.
