06:00
Day 25
Carleton College
Stat 220 - Spring 2025
Open the following shinyapps and explore a little bit.
With the folks around you, discuss:
06:00
I’ve posted a new version of the app at https://stat220-s25.github.io/files/25-starter-app.R
data-prep.R
write_rds(manager_survey, "manager-survey/data/manager-survey.rds")
app.R
file, load the data with read_csv
manager_survey <- read_rds("data/manager-survey.rds")
03:00
"id"
is how you refer to the input in the server function (input$id
)"Label"
is how the input is labeled in the appvalue
refers to the default value (not all inputs have this option)choices
refers to the possible options that are listed (not all inputs have this option)sliderInput
to the appropriate tab panel04:00
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
textOutput("panel")
),
mainPanel(
tabsetPanel(
id = "tabset",
tabPanel("panel 1", "one"),
tabPanel("panel 2", "two"),
tabPanel("panel 3", "three")
)
)
)
)
server <- function(input, output, session) {
output$panel <- renderText({
paste("Current panel: ", input$tabset)
})
}
Add theme = bslib::bs_theme()
to your ui()
function, and bslib::bs_themer()
to your server function to try out different options interactively
04:00
Shiny apps need to be “connected” to RStudio or a remote RStudio server
You can deploy shiny apps online
Your app and files should be in their own folder and the entire folder is what you “deploy”. You do not want multiple app.R
or .Rmd
files in that folder!