Open your completed Week 6 slider_app.R and click Run App.
UI: input controls and output locations
The controls let users supply values. plotOutput() creates a named placeholder for the server to fill (Wickham (2021), section 2.3).
selectInput("modality", "Output group",
choices = c("Spoken output" = "speech",
"Written output" = "writing"))
sliderInput("binwidth", "Bin width (ms)",
min = 25, max = 300, value = 100)
plotOutput("rt_plot")Server: read inputs and calculate outputs
input$ reads control values; output$ defines displayed results using render functions. Dependent outputs update when inputs change.
output$rt_plot <- renderPlot({
selected_data <- filter(
d_participants,
modality == input$modality
)
ggplot(selected_data, aes(x = mean_rt)) +
geom_histogram(
binwidth = input$binwidth)
})Your task: match the two controls and plot location to their server counterparts. Identify the matching names. Predict and test each control’s effect.