Key Points
- A Shiny app is an R program that generates interactive web
content.
- A Shiny app has three required parts: a user interface, a server
function, and a call that runs the app.
- The user interface defines what the app looks like, while the server
defines how it behaves.
- Shiny works by generating HTML in R, which is rendered by a web
browser.
- The user interface (UI) defines what appears in a Shiny app.
- UI elements are created using ordinary R functions provided by
Shiny.
- Many UI functions generate HTML elements that are rendered by a web
browser.
- Layout functions define the overall structure of the app, while
other UI functions define the content placed within that structure.
-
Reactivity is central to how Shiny apps update in
response to changes in user input.
- Code inside
render*() functions is automatically re‑run
when its reactive dependencies change.
- Repeating the same data preparation logic across multiple outputs
can make apps harder to maintain.
-
reactive() expressions allow shared server logic to be
computed once and reused across multiple outputs.
- A Shiny app must be hosted on a service capable of running R.
- shinyapps.io provides a simple way to publish Shiny apps.
- The same Shiny concepts can be used to build more complex
applications.
- Shiny apps can be extended by modifying the same user interface,
server, and reactive patterns used to build the original app.
- New app features often require changes in both the user interface
and server code.
- Reactive expressions can be reused when adapting an app to work with
different variables or datasets.
- Once you understand the basic structure of a Shiny app, it is often
straightforward to adapt it to answer new questions.