1.3 Running and stopping the app

The basic workflow of shiny app development is…

  1. Write some code
  2. Start the app
  3. Play with the app
  4. Write some more code
  5. Repeat…

A simple diagram of the Shiny development process.

1.3.1 Running the app

There are a few ways you can run your app

If using R Studio:

  • Click Run App button in document toolbar
  • Keyboard shortcut is CMD / CTRL + SHIFT + ENTER

If not using R Studio:

  • (source()) the whole document or call shiny::runApp()

The console message #> Listening on http://127.0.0.1:3827 identifies your app in any (local) web browser.

  • 127.0.0.1 is a standard address = this computer
  • last 4 digits = randomly assigned port number

Running a Shiny app keeps R busy and you will not be able to execute other commands in the console at that time.

1.3.2 Stopping the app:

  • STOP sign on console toolbar
  • ESC from within R console (CTRL + C is not in R Studio)
  • Close shiny app window