Shiny App Development Basics
Instruction: Outline the key components of a Shiny app and demonstrate with a simple example.
Context: This question tests the candidate's familiarity with developing interactive web applications using Shiny, showcasing their ability to create dynamic analysis tools.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
A Shiny app has a UI describing inputs/output placeholders and a server function defining reactive computations. Save the following as app.R and run it with Shiny. The fixed base sample makes changes in the mean easy to distinguish from new random draws.
library(shiny) ui <- fluidPage( titlePanel("Illustrative shifted distribution"), sliderInput("shift", "Mean shift", min = -5, max = 5, value = 0), plotOutput("distribution") ) server <- function(input,...