Session 1 - Data Visualization

R, the Tidyverse, + Making Good Charts

September 10, 2021

Overview

This is an overview of the September 10th session of LBJ Data Studio. Matt Worthington led today’s session and Ethan supported participants for the duration of the session.

LBJ Studio Dates + Formats

Below are the dates and formats of the session. Our original plan was to eventually hold these in-person, but they will be held on zoom for the first few sessions. The session referenced on this page is highlighted in bold.

  • Zoom Session: Sep 10, 2021 at Noon
  • Zoom Session: Sep 24, 2021 at Noon
  • Zoom Session: Oct 8, 2021 at Noon
  • In-person: Oct 22, 2021 at Noon in Room 3.124 at the LBJ School
  • TBD: Nov 5, 2021 at Noon
  • TBD: Nov 19, 2021 at Noon
  • TBD: Dec 3, 2021 at Noon

What’s Covered In This Session

For this session, we focused on the following topics.

  • Navigating Rstudio
  • Rstudio Interface
  • R Projects
  • Basics of ggplot2
    • ggplot()
    • aes()
    • geom_*()
    • scale_*()
    • theme_*()
    • labs()
  • Exporting Data & Charts
    • ggsave()

Session Materials

Github Materials

Below is a link to the materials used during the session. Participants followed along with the materials in the slides using the series of R Scripts below. To download the materials, you’ll need to visit Github and download from there (see screenshot below). Once downloaded, place the files in a location on your computer (example: the desktop or documents folder).

Note for Windows users: will want to make sure to extract the downloaded zip before working with the materials.

Downloading Github Materials

Reference Materials

Below is a list of useful resources for learning ggplot2. They won’t cover everything you’ll want to know, nor will every resource here resonate with you. Rather, different resources will likely resonate with different people. Nevertheless, all of them are great and come highly recommended by folks across the world of R.

  • The Session Slides Generally speaking, you shouldn’t expect to remember everything you code or write. Referencing back to materials you’ve already viewed or read is very common when coding. Over time, certain things will get easier to remember, but having slides like these helps in a pinch.
  • #ggplot2 hashtag on Twitter People share a ton of great material for R users of every skill level on Twitter. If you’re looking for inspiration and want to see what code people used to make a specific chart, this is the spot to do it. For additional R resources outside of ggplot2, use the #rstats.
  • The ggplot2 Website This has a ton of great documentation about every aspect of ggplot2 whether you want to learn about different functions available in the package or discover extension packages or additional learning resources specifically focused on ggplot2.
  • Chapter 3 of R For Data Science R for Data Science is a phenomemal book for anyone wanting to learn how to use R + the Tidyverse from scratch. Chapter 3 specifically focuses on ggplot2 and has tons of exercises that work with the basic install of RStudio, R, and the tidyverse packages. There’s also a great Slack channel where you can ask roughly ~10k people questions about each of the topics covered by a chapter and get great feedback.
  • ggplot2 Cheatsheets This is a very useful cheat sheet to print and keep handy at your desk whenever coding.
  • ggplot2tor This is just a really well organized site that has tons of great tutorials and tools for finding what you need in ggplot2.

Acknowledgements

Photos used in the slide deck by Tim Arterbury and Leonardo Corral on Unsplash