Skip to content

Interactive Visualizations with RStudio Workshop for UNCC DSI

Notifications You must be signed in to change notification settings

wesslen/iviz-rstudio-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interactive Visualizations with RStudio

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

Sponsored by

Date, Time and Location

  • July 18 (Part 1), July 25 (Part 2), and August 1 (Part 3)

  • 5:30 pm - 8:15 pm

  • Packard Place Classroom 110M

Instructor

Workshop Overview

Pre-workshop Work

Please read and complete the workshop installation steps.

Optional: Sign up for a free DataCamp account and complete these two courses:

Part 1: Intro to tidyverse and Shiny

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

Part 2: Shiny and htmlwidgets

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.

Part 3: RMarkdown/Advanced Shiny

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

Workshop Instructions:

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.

Run R/RStudio Locally

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:

  1. Download R and R Studio.

  2. Download this GitHub repo through the Download button or clone.

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
  1. Open the file project.Rproj in RStudio.

Installing packages

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")

Resources

Help!

This page is your best source for R help

Please read if you run into R-relate problems.

Tidyverse / Intro to R:

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:

DataCamp Tracks:

RStudio Workshops & Webinars

RStudio::conf Workshops:

Past R Studio Webinars

R Markdown / Shiny

Shiny

R Markdown

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.)

Flexdashboard

Blogdown

Computational Social Science & Social Media Data

I've taught several past R workshops for text analysis, social media, and Computational Social Science.

Social Media Data Sources

Releases

No releases published

Packages

No packages published

Languages