Authors: Jared Andrews1
Last modified: June 17th, 2023.

Overview

Description

This workshop is designed to introduce participants to the basics of R Shiny, a web application framework for R. Shiny is a powerful tool that can be used to create interactive, re-usable, and shareable web applications that can be used to explore and visualize data, and to create interactive reports.

In particular, this curriculum is geared towards researchers of all fields, scientists, clinicians, statisticians, and bioinformaticians to emphasize how Shiny can be more than a way for researchers to dig through data - it can be a powerful framework for expert bioinformaticians to streamline figure generation and interpretation they’re doing themselves.

Pre-requisites

This workshop expects participants to have:

  • Basic knowledge of R syntax
  • Basic familiarity with the RStudio IDE

Additional Reading

While it’s not necessary to read these resources before the workshop, they may be helpful for those interested in learning more about Shiny:

  • Shiny Basics - This is a tutorial on the basics of Shiny.
  • Mastering Shiny - This is a free online book that covers the core aspects of Shiny in-depth.
  • Shiny Cheatsheet - A handy cheatsheet for Shiny syntax and functionality.

For more advanced users, see:

  • R Packages - Additional info for creating an R package.
  • Engineering Shiny - A free book describing intermediate to advanced concepts for production-grade Shiny apps, particularly in terms of app structure. Created with the golem package in mind, but many of the concepts are applicable to any Shiny app.
  • shinytest2 - For writing tests for Shiny apps.

Participation

This workshop is designed as an instructor-led, hybrid-format experience. The material will remain available online for self-paced learning indefinitely.

An Important Note About This Workshop

Learning Shiny is not just about writing code, but also about thinking in terms of reactivity. This is a new way of programming for many, and it can take a bit of time to adjust.

This workshop has a lot of content, and there’s no requirement that it all be covered in one session (or at all). The first two modules are the most important, so if taking an instructor-led workshop, please ask lots of questions.

If leading a workshop with this material, care should be taken to move at whatever pace is necessary to make sure everyone understands the concepts in the first two modules before moving on.

Don’t worry if you don’t understand everything perfectly, but if you’re finding yourself confused, please don’t hesitate to speak up.

R / Bioconductor Packages Used

This workshop utilizes the following packages:

Workshop Outline

This workshop was designed to be covered in ~2.5-3 hours and includes 3 hands-on modules (which have interactive documents that can be accessed via the links below for St. Jude members while on the St. Jude network):

Activity Time
Core Shiny Concepts 45m
Shiny Application Development 75m
Common Gotchas, Debugging Shiny, and App Deployment 30m

Learning Goals

The goals of this workshop are for participants to:

  1. Recognize how interactive, re-usable tooling can help them work more efficiently and effectively.
  2. Understand how such tooling can empower laboratory scientists to better understand and investigate their data to derive meaningful insights.
  3. Gain a strong foundational knowledge of basic R Shiny functionality and development that they can incorporate into their own work.

Learning Objectives

By the end of this workshop, participants should have:

  • A basic understanding of how Shiny works and how to think in terms of reactivity.
  • Basic experience with varied Shiny input/output types.
  • The ability to create interactive plots via plotly and allow real-time user-customization of plot aesthetics/content.
  • An idea as to how to develop an increasingly complex Shiny application to run & explore PCA results.
  • The ability to package Shiny applications as re-usable R functions.

Usage

Anyone is free to use this content for their own uses with proper attribution (link back to this repo/site).


  1. St. Jude Children’s Research Hospital↩︎