Lecture 29
College of Idaho
CSCI 2025 - Winter 2026
update* FamilyupdateTextInput(), updateSliderInput(), updateSelectInput(), etc.observeEvent().Consider this scenario from Chapter 9 of the textbook.
Create an app that lets the user upload a csv file, select one variable, draw a histogram, and then download the histogram. For an additional challenge, allow the user to select from .png, .pdf, and .svg output formats.
tabsetPanel(id = "wizard", type = "hidden", ...)updateTabsetPanel(inputId = "wizard", selected = "panel2", session = session)ui <- fluidPage(
actionButton("go_next", "Next"),
tabsetPanel(id = "wizard", type = "hidden",
tabPanel("page1", "First step content..."),
tabPanel("page2", "Second step content...")
)
)
server <- function(input, output, session) {
observeEvent(input$go_next, {
updateTabsetPanel(inputId = "wizard", selected = "page2", session = session)
})
}uiOutput and renderUIuiOutput("id") where you want the content.renderUI({ ... }) to output$id.renderUI block must return Shiny tags (e.g., tagList, div, inputs).renderUI -> creates input -> input changes -> triggers renderUI -> re-creates input.update*Input).tabsetPanel).uiOutput/renderUI).