Welcome! This is a workshop for the Cascadia R conference that is meant to be a gentle introduction to data visualization using the ggplot2 and the plotly packages.

You’ll learn the basics of the grammar of graphics and learn how to visualize and understand relationships between different kinds of variables in your dataset.


Please make sure to have this completed prior to the workshop beginning. Reading over all the materials here will help you get an understanding of what is to be expected and a better grounding to dive into the material as the workshop gets started. To participate in this workshop, you’ll need to do the following on your own laptops:

  1. Have the latest version of R AND RStudio installed (Directions are here)
  2. Be familiar with the basics of the RStudio Interface
  3. We further recommend you read through the first two chapters of the free ModernDive textbook to get up-to-speed/refreshed on R programming. It isn’t essential that you do everything there, but we will expect you have gone through this material prior to the workshop starting. If you have questions about this prerequisite material, please reach out!
  4. Have the following R packages installed: dplyr, readr, plotly, gapminder, remotes, fivethirtyeight, and ggplot2.

    This can be accomplished by copying the following code into the Console in RStudio and pressing Enter. Note that you’ll see quite a few lines of code run while the packages are installing. Don’t be alarmed. After all of these packages are installed you should see them listed in the Packages tab in the bottom right section of RStudio.

    We needed to install the developmental version of the ggplot2 package in order for it to work nicely with the plotly package in Part 3 of this workshop and this is the reason for installing the remotes package as well.

    install.packages(c("dplyr", "readr", "plotly", "gapminder", "remotes", "fivethirtyeight"))
    • The tidyverse contains a variety of different packages that will be useful in your analysis including the ggplot2 package that will be the focus of this workshop. We’ll also use the dplyr package for data wrangling and the readr package for reading in data.
    • The plotly package will be used for interactive graphics.
    • The gapminder package contains a data set made famous by Hans Rosling exploring data on the world’s countries.
    • The fivethirtyeight package contains many datasets used by data journalists at FiveThirtyEight.com.


You’ll be following along in the Part1-ggplot2_intro.Rmd, Part2-working_with_factors.Rmd, and Part3-interactive_plots.Rmd files, running the R code in the “chunks” there, and writing your own code to practice. You can also follow along with the webpage for the workshop at https://cascadiarconf-viz.netlify.com.

Remember, in this workshop we will adhere to the code of conduct for this conference. Be respectful of your fellow students, workshop leaders, and workshop TAs and let’s learn together.

Outline of this Workshop

Please bring a pencil, at least one color of pen, and some paper to write on.

  1. Visualizing continuous data (scatterplots)
    • Learning about aesthetics and mapping of variables
    • Some basic geometries
  2. Visualizing categorical data
    • More about geoms
    • Learning to create small multiple plots using faceting
  3. Visualizing categorical versus continuous data (boxplots and violin plots)
  4. Making your plots interactive using the ggplotly() function in the plotly package