Building Web Apps with R Shiny

A 4-Day Remote Seminar Taught by Lisa Debruine, Ph.D.

Shiny apps let you make web applications that do anything you can code in R. For example, you can share your data analysis in a dynamic way with people who don’t use R, collect and visualize data, or even make data aRt.

While there is a wealth of material available on the internet to help you get started with Shiny, it can be difficult to see how everything fits together. This class will take a predominantly live coding approach, rather than a lecture-only approach, so you can code along with the instructor and deal with the inevitable bugs and roadblocks together.

This class will teach you the basics of Shiny app programming, giving you skills that will form the basis of almost any app you want to build. By the end of the class, you will have created a custom app that collects and saves data, allows users to dynamically visualize the data, and produces downloadable reports.

Starting July 27, we are offering this seminar as a 4-day synchronous*, remote workshop for the first time. Each day will consist of a 3-hour live lecture held via the free video-conferencing software Zoom. You are encouraged to join the lecture live, but will have the opportunity to view the recorded session later if you are unable to attend at the scheduled time.

Each lecture session will conclude with a hands-on exercise reviewing the content covered, to be completed on your own. An additional lab session will be held Tuesday and Thursday afternoons, where you can review the exercise results with the instructor and ask any questions.

*We understand that scheduling is difficult during this unpredictable time. If you prefer, you may take all or part of the course asynchronously. The video recordings will be made available within 24 hours of each session and will be accessible for two weeks after the seminar, meaning that you will get all of the class content and discussions even if you cannot participate synchronously.

More Details About the Course Content

The following are some diverse examples of Shiny apps that the instructor has made.

Computing

To participate in the hands-on exercises, you are strongly encouraged to use a computer with the most recent version of R installed. Participants are also encouraged to download and install RStudio, a front-end for R that makes it easier to work with. This software is free and available for Windows, Mac, and Linux platforms.

Who Should Register?

You need to have basic familiarity with R, including data import, data processing, visualization, and functions and control structures (e.g., if/else). Instruction will be done using RStudio. Some familiarity with ggplot2 and dplyr would be useful. You definitely do not need to be an expert coder, but the following code should not be challenging to understand.

library(ggplot2)

pets <- read.csv("pets.csv")

dv <- sample(c("score", "weight"), 1)

if (dv == "score") {

  g <- ggplot(pets, aes(pet, score, fill = country))
} else if (dv == "weight") {

  g <- ggplot(pets, aes(pet, weight, fill = country))
}

g + geom_violin(alpha = 0.5)

If you want to brush up on your R (especially tidyverse), and also gain familiarity with the instructor’s teaching style, the first seven chapters of Data Skills for Reproducible Science (https://psyteachr.github.io/msc-data-skills/) provide a good overview.

Outline

Day 1

Your First Shiny App

  • Overview of the UI/server structure
  • Inputs, outputs, and action buttons
  • Reactive functions

ShinyDashboard

  • Basic template for shinydashboard projects
  • Sidebar, menu navigation, and tabs
  • Row- and column-based layouts

Day 2

Basic Patterns

  • Different input types
  • Different output types
  • Reading and saving data
  • Reactive functions

Day 3

Customizing Your Apps

  • CSS, HTML, and Javascript
  • Structuring a complex app

Intermediate Patterns

  • Debugging and error handling
  • Displaying elements contingent on the state of other elements

Day 4

Sharing Your Apps

  • io
  • Self-hosting a shiny server
  • GitHub
  • In an R package

Advanced Patterns

  • Creating and downloading a customized report
  • Shiny modules for repeated structures

Seminar information

Tuesday, July 27, 2021 –
Friday, July 30, 2021

Each day will follow this schedule:

11:00am-2:00pm ET (New York time): Live lecture via Zoom

4:00pm-5:00pm ET: Live lab session via Zoom (Tuesday and Thursday only)

Payment Information

The fee of $895 includes all course materials.

PayPal and all major credit cards are accepted.

Our Tax ID number is 26-4576270.