13.4 Outputs

Shiny apps can include a variety of output elements including plots, tables, texts, images and HTML widgets.

HTML widgets are objects for interactive web data visualizations created with JavaScript libraries.

Examples of HTML widgets are interactive web maps created with the leaflet package and interactive tables created with the DT package.

HTML widgets are embedded in Shiny by using the htmlwidgets package (Vaidyanathan et al. 2021).

  • We can use the values of inputs to construct output elements, and this causes the outputs to update each time input values are modified.

Shiny provides several output functions *Output() that turn R objects into outputs in the user interface. Example

  • TextOutput() creates text

  • TableOutput() creates a data frame, matrix or other table-like structure.

  • ImageOutput() creates an image.

The *Output() functions require an argument called outputId that denotes the id of the reactive element that is used when the output object is built in server(). A full list of input and output functions can be found in the Shiny reference guide