In this three-part workshop series, we’ll use RStudio tools like tidyverse, Shiny, and htmlwidgets to develop interactive visualizations.
Beer Related Tweets | Russian Twitter Trolls |
---|---|
![]() ![]() |
![]() ![]() |
-
July 18 (Part 1), July 25 (Part 2), and August 1 (Part 3)
-
5:30 pm - 8:15 pm
-
Packard Place Classroom 110M
Please read and complete the workshop installation steps.
Optional: Sign up for a free DataCamp account and complete these two courses:
- Introduction to the tidyverse (only chapter 1; other chapters cost $)
- Building Web Applications in R with Shiny (entire course is free!)
We’ll introduce RStudio along with tidyverse
, a unified set of R packages for end-to-end data science. These packages include core data science workflow tools for data acquisition, processing and visualization. We’ll end with an introduction to Shiny, an R package for building interactive web apps. Shiny apps are flexible web applications that can be embedded within web pages, dashboards, and RMarkdown output like presentations or notebooks.
Day 1: Wed July 18 | Intro to tidyverse and Shiny |
---|---|
Welcome | PollEverywhere, this GitHub Page & RStudio.Cloud sign-up |
Lecture | Introduction to Tidyverse |
Hands On Tutorial | Russian Twitter Trolls / HTML |
Lecture | Introduction to Shiny |
Hands On Tutorial | Shiny Hello World and deploying to shinyapps.io |
Help & Resources | How to ask for help |
Home Assignment | See below |
Home assignment
Use the Russian Twitter Troll data set to create a shiny app that queries on the keyword. The app should output the plotly-ggplot2 time series chart from 01-russian-trolls.R.
Extra studying
Shiny
Tidyverse
- tidyverse learnR practice
- Data Carpentry: R for data analysis and visualization of Ecological Data
- Chapters 3, 5, and 7 in R for Data Science
We’ll dive deeper into Shiny apps and review basic architecture, layouts, and reactivity with hands-on examples. We’ll also introduce htmlwidgets (e.g., plotly, r2d3, leaflet), simple R packages for producing HTML-based interactive visualizations that can be extended with HTML, CSS, and JavaScript. In this part, we’ll visualize important aspects of social media data like social networks, unstructured text, and geospatial data.
Day 2: Wed July 25 | Shiny and htmlwidgets |
---|---|
Refresher & Warm-up | PollEverywhere and Part 1 Assignment |
Lecture | Shiny Reactivity |
Hands On Tutorial | Reactivity code |
Help & Resources | RMarkdown & Shiny References |
Demo / Website | htmlwidgets |
Hands On Tutorial | htmlwidget code / HTML |
Home Assignment | Mini-project |
Home assignment
Use one of the three project data sets to develop your own Shiny app. You can work individually or in groups of two.
You will have the opportunity to present your app next time in class (completely optional) in case you want my or classmates' feedback. I can also work with anyone who's interested in putting their code/app online (e.g., GitHub) to create your Data Science portfolio.
We’ll consider more advanced layout templates like shinydashboard to provide professional looking dashboard templates. We’ll also explore advanced Shiny functionality including interactions, persistent storage, and opimizing/scaling apps up (e.g., modular functions and async programming).
Day 3: Wed Aug 1 | Advanced Shiny |
---|---|
Warm-up | PollEverywhere |
Present Projects | Students present their Shiny tools (optional). |
Hands On Tutorial | Intro to RMarkdown |
Lecture | Templates shinydashboard / flexdashboard |
Help & Resources | Pulling Social Media Data |
Lecture | Profvis / Async Programming / Persistent Storage / radiant |
We'll use RStudio Cloud for the workshop. RStudio Cloud enables a collaborative workspace where participants can run pre-saved code. This avoids the headaches of everyone's unique machine set up.
To get started, sign up for a free account https://rstudio.cloud (no need if you already have an account). If you already have a shinyapps.io account, you can use those credentials instead.
Students will be emailed the workshop link the week of the first workshop.
The cloud is great for workshop materials; but it is limited to only 1GB of memory. That's why RStudio Cloud is best only for this workshop, not long term.
For bigger projects, install R and RStudio locally so you can have the materials for your long-term research/work purposes. To install R/RStudio locally:
If you have Git setup on your computer, you can clone the repo into your current directory via terminal (command line):
git clone https://github.com/wesslen/iviz-rstudio-workshop.git
- Open the file
project.Rproj
in RStudio.
To install the workshop's packages, run the file 00-install-packages.R
. It runs this code:
packages <- c("tidyverse","plotly","shiny","leaflet","dygraphs","flexdashboard","ggridges","learnr",
"xts","igraph","visNetwork","tidytext","collapsibleTree","shinydashboard","devtools",
"digest","htmltools","htmlwidgets", "jsonlite","Rcpp","rstudioapi","yaml")
install.packages(packages)
# need ggplot2 for plotly
devtools::install_github('hadley/ggplot2')
devtools::install_github("rstudio/r2d3")
This page is your best source for R help
Please read if you run into R-relate problems.
These resources are a best place to learn the basics. Traditionally, R was taught on the core (or "Base") R packages. More recently, tidyverse has become the modern approach to learning R.
I highly recommend R for Data Science Book for anyone wanting to learn R (and applying Data Science).
You may also find these websites very helpful for each package:
- Data Manipulation for R Track
- Data Visualization for R Track
- Statistics with R
- Machine Learning in R
RStudio::conf Workshops:
- Amelia McNamera's Introduction to R & RStudio
- Charlotte Wickham's Data Science in Tidyverse
- Mine Cetinkaya-Rundel's Intro to Shiny & RMarkdown
- Joe Cheng & Dean Attali's Intermediate Shiny
- Shiny (Interactive Visualizations)
- Shiny Gallery
- Tutorial (Basics)
- Tutorial (Intermediate)
- Tutorial (Deployment)
- Where to deploy test Shiny Apps
- Tracking interactions
- Bring Google Analytics data back into R
R Markdown is an example of literate programming, i.e., code combined with plain language (as well as code output). The output can be an HTML, pdf, or even a Word document!
R Markdown can do nearly anything -- build a website, write a LaTeX paper for publication, even write a book! (For example, R for Data Science is written in R Markdown. See the GitHub.)
I've taught several past R workshops for text analysis, social media, and Computational Social Science.