

You’ll learn more about outputs in Section 2.3. VerbatimTextOutput() displays code and tableOutput() displays tables.

VerbatimTextOutput() and tableOutput() are output controls that tell Shiny where to put rendered output (we’ll get into the how in a moment). You’ll learn more about inputs in Section 2.2. In this case, it’s a select box with the label “Dataset” and lets you choose one of the built-in datasets that come with R. SelectInput() is an input control that lets the user interact with the app by providing a value. You’ll learn more about them in Section 6.2. Ui <- fluidPage ( selectInput ( "dataset", label = "Dataset", choices = ls ( "package:datasets" ) ), verbatimTextOutput ( "summary" ), tableOutput ( "table" ) )įluidPage() is a layout function that sets up the basic visual structure of the page.

I’ll cover other workflow patterns in Chapter 5. If you’re using RStudio, you don’t even need to stop and re-start the app to see your changes - you can either press the Reload app button in the toolbox or use the Cmd/Ctrl + Shift + Enter keyboard shortcut. The basic workflow of Shiny app development is to write some code, start the app, play with the app, write some more code, and repeat. You can stop the app and return access to the console using any one of these options:Ĭlick the stop sign icon on the R console toolbar.Ĭlick on the console, then press Esc (or press Ctrl + C if you’re not using RStudio). This means that you can’t run new commands at the R console until the Shiny app stops. While a Shiny app is running, it “blocks” the R console. You can enter that URL into any compatible 2 web browser to open another copy of your app.Īlso notice that R is busy: the R prompt isn’t visible, and the console toolbar displays a stop sign icon. This tells you the URL where your app can be found: 127.0.0.1 is a standard address that means “this computer” and 3827 is a randomly assigned port number.
