
Lecture 19
Cornell University
INFO 5001 - Fall 2025
November 4, 2025
Every Shiny app has a webpage that the user visits,
and behind this webpage there is a computer that serves this webpage by running R (or Python!).
When running your app locally, the computer serving your app is your computer.
When your app is deployed, the computer serving your app is a web server.


User interface controls the layout and appearance of app
Server function contains instructions needed to build app
#| '!! shinylive warning !!': |
#| shinylive does not work in self-contained HTML documents.
#| Please set `embed-resources: false` in your metadata.
#| standalone: true
#| viewerHeight: 700
library(shiny)
library(bslib)
# Define UI ----
ui <- page_fillable(
sliderInput(
inputId = "num",
label = "Choose a number",
min = 0,
max = 100,
value = 20
)
)
# Define server logic ----
server <- function(input, output) {}
# Run the app ----
shinyApp(ui = ui, server = server)<div class="form-group shiny-input-container">
<label class="control-label" id="num-label" for="num">Choose a number</label>
<input class="js-range-slider" id="num" data-skin="shiny" data-min="0" data-max="100" data-from="20" data-step="1" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-keyboard="true" data-data-type="number"/>
</div>
| Function | Outputs |
|---|---|
plotOutput() |
plot |
tableOutput() |
table |
uiOutput() |
Shiny UI element |
textOutput() |
text |
#| '!! shinylive warning !!': |
#| shinylive does not work in self-contained HTML documents.
#| Please set `embed-resources: false` in your metadata.
#| standalone: true
#| viewerHeight: 700
library(shiny)
library(bslib)
# Define UI ----
ui <- page_fillable(
sliderInput(
inputId = "num",
label = "Choose a number",
min = 0,
max = 100,
value = 20
),
plotOutput("myplot")
)
# Define server logic ----
server <- function(input, output) {}
# Run the app ----
shinyApp(ui = ui, server = server)Modern UI toolkit for Shiny based on Bootstrap:
Creation of delightful and customizable Shiny dashboards with cards, value boxes, sidebars, etc.
Use of modern versions of Bootstrap and Bootswatch
ae-17Instructions
ae-17 (repo name will be suffixed with your GitHub name).renv::restore() to install the required packages, open the Quarto document in the repo, and follow along and complete the exercises.Instructions
age-rule folder, and launch the app by opening the app.R file and clicking on Run App.Instructions