The finished interface

The other element that goes in mainPanel() is an area to handle reactive text that is generated within the server.R file—that is, a call to textOutput() with the name of the output as defined in server.R—in this case, textDisplay.

The finished interface looks similar to the following screenshot:

If you're getting a little bit lost, don't worry. Basically, Shiny is just setting up a framework of named input and output elements; the input elements are defined in ui.R and processed by server.R, which then sends them back to ui.R, which knows where they all go and what types of output they are.

Get Web Application Development with R Using Shiny - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.