Power BI shows data. R Shiny builds decision tools. This week is the centrepiece of the EDUSHARK programme. You will build a complete interactive dashboard from a single R file, learn how reactivity works under the hood, and deploy your app to a public URL on shinyapps.io. By Friday, you have something you can pin to your portfolio.
What You'll Learn This Week
Hello, Shiny
A complete interactive app in under 30 lines
ui that describes the page, and a server function that reads inputs and writes outputs. Shiny re-runs the server logic automatically whenever an input changes - this is reactivity, and it is the whole magic.
Save as app.R and click Run App in RStudio.
UI Components and Layout
Inputs you'll use weekly
textInput, numericInput, sliderInput, selectInput, checkboxInput, checkboxGroupInput, radioButtons, dateInput, dateRangeInput, fileInput, actionButton.
Outputs and their renderers
plotOutput ↔ renderPlot, tableOutput ↔ renderTable, DT::DTOutput ↔ DT::renderDT, textOutput ↔ renderText, uiOutput ↔ renderUI.
Layouts
fluidPage, sidebarLayout, fluidRow + column, tabsetPanel, navbarPage.
Reactivity Deep Dive
The mental model you must own
Sources
Inputs: input$x. The user clicks; this is where re-evaluation starts.
Conductors
reactive({}) expressions. Compute values used by multiple outputs.
Endpoints
Outputs (output$plot) and observers. Where reactivity ends.
filtered) returns the function itself, not the value. Always filtered().Interactive Visualisations
shinydashboard and bslib
Professional UI without writing CSS
For a more modern look, use bslib::bs_theme(version = 5, bootswatch = "minty") with bslib::cards() and layout_columns() - a polished Bootstrap-5 theme without writing any CSS.
Deployment
From localhost to a public URL
shinyapps.io in five clicks
- Create a free account at shinyapps.io.
- In RStudio:
Tools → Global Options → Publishing → Connect. - Open your
app.R, click the blue Publish icon. - Pick the files to deploy. RStudio uploads and builds.
- Open the URL it gives you. Done.
.rds files, pin packages with renv, wrap risky code in tryCatch(), add a showNotification() for slow operations.Project: Interactive Business Dashboard
Deploy a multi-tab Shiny dashboard for the e-commerce dataset:
- Tab 1: KPI overview (revenue, AOV, orders, conversion) with date-range filter.
- Tab 2: Region drill-down with cross-filtering.
- Tab 3: Customer table (DT) with filters and CSV export.
- Tab 4: Plotly scatter - units vs revenue, sized by margin.
- Deployed to shinyapps.io with a public URL.
A full starter app lives at /data/week8-shiny-app-starter.R - download, adapt, ship.