Wrap-up + Shiny

Lecture 25

Dr. Mine Çetinkaya-Rundel

Duke University
STA 199 - Spring 2024

2024-04-23

Warm up

While you wait for class to begin…

Take the time to fill out course and TA evaluations!

Want to nominate a TA as “TA of the Year”? Send an email to dus@stat.duke.edu with your nomination.

AE 19 - Last one!

  • Go to your ae repo, and pull.

  • Make a change, any change, to ae-19-last-ae.qmd. render, commit, and push.

Announcements

  • Finalize (render, commit, push) by 8 am tomorrow (Wednesday) morning

  • Fill out last peer evaluations by Sunday

Awards

People’s Choice - Honorable Mentions

  • Section 1 - Green Beans - Forest Fires: https://sta199-s24.github.io/project-green_beans/presentation.pdf

  • Section 3 - Team E - Red Wine Quality: https://sta199-s24.github.io/project-team_e/presentation.pdf

  • Section 5 - Inside Investigators - NYC Crime: Perpetrator Demographics & Crime by Borough: https://sta199-s24.github.io/project-inside_investigators

People’s Choice 🏆

Section 2 - Data Devils - Gender Pay Gap by Industry: https://sta199-s24.github.io/project-data_devils/presentation.pdf

Most commits to project - Honorable mentions

Most commits to project 🏆

Most activity on Ed - Honorable mentions

Most activity on Ed 🏆

Best ugly plot - Honorable mentions

Gigi Dunn

Erica Shen

Harika Amineni

Best ugly plot 🏆

Lina Leyhausen

Shiny

Shiny

Shiny is an R package that makes it easy to build interactive web apps straight from R. You can host standalone apps on a webpage or embed them in R Markdown documents or build dashboards. You can also extend your Shiny apps with CSS themes, htmlwidgets, and JavaScript actions.

Shiny App


Server

+


⇄

Client / Browser

+ +

Anatomy of an App

library(shiny)

shinyApp(
  ui = list(
    # new (to you) widgets go here
  ),
  
  server = function(input, output, session) {
    # somewhat familiat (to you) code goes here
  }
)library(shiny)

shinyApp(
  ui = list(
    # new (to you) widgets go here
  ),
  
  server = function(input, output, session) {
    # somewhat familiat (to you) code goes here
  }
)library(shiny)

shinyApp(
  ui = list(
    # new (to you) widgets go here
  ),
  
  server = function(input, output, session) {
    # somewhat familiat (to you) code goes here
  }
)library(shiny)

shinyApp(
  ui = list(
    # new (to you) widgets go here
  ),
  
  server = function(input, output, session) {
    # somewhat familiat (to you) code goes here
  }
)

Shiny Widgets Gallery

https://shiny.posit.co/r/gallery/widgets/widget-gallery/

A brief widget tour

rundel.shinyapps.io/widgets/

Live demo

Let’s make a weather app!

Go to https://github.com/sta199-s24/shiny-demo to follow along.

Note

If you want to code along, click on the “Use this template” button to create a copy of this repo for yourself, clone it in RStudio, and code along as usual.

🔗 sta199-s24.github.io  ·  ❓ Ask on Ed

1 / 21
Wrap-up + Shiny Lecture 25 Dr. Mine Çetinkaya-Rundel Duke University STA 199 - Spring 2024 2024-04-23

  1. Slides

  2. Tools

  3. Close
  • Wrap-up + Shiny
  • Warm up
  • While you wait for class to begin…
  • AE 19 - Last one!
  • Announcements
  • Awards
  • People’s Choice - Honorable Mentions
  • People’s Choice 🏆
  • Most commits to project - Honorable mentions
  • Most commits to project 🏆
  • Most activity on Ed - Honorable mentions
  • Most activity on Ed 🏆
  • Best ugly plot - Honorable mentions
  • Best ugly plot 🏆
  • Shiny
  • Shiny
  • Shiny App
  • Anatomy of an App
  • Shiny Widgets Gallery
  • A brief widget tour
  • Live demo
  • f Fullscreen
  • s Speaker View
  • o Slide Overview
  • e PDF Export Mode
  • b Toggle Chalkboard
  • c Toggle Notes Canvas
  • d Download Drawings
  • ? Keyboard Help