A gRadual intRoduction to data visualization
Chester Ismay and Ted Laderas
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
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:
Have the latest version of R AND RStudio installed (Directions are here)
Be familiar with the basics of the RStudio Interface
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!
Have the following R packages installed:
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
ggplot2package in order for it to work nicely with the
plotlypackage in Part 3 of this workshop and this is the reason for installing the
remotespackage as well.
install.packages(c("dplyr", "readr", "plotly", "gapminder", "remotes", "fivethirtyeight")) remotes::install_github("tidyverse/ggplot2")
tidyversecontains a variety of different packages that will be useful in your analysis including the
ggplot2package that will be the focus of this workshop. We'll also use the
dplyrpackage for data wrangling and the
readrpackage for reading in data.
plotlypackage will be used for interactive graphics.
gapminderpackage contains a data set made famous by Hans Rosling exploring data on the world's countries.
fivethirtyeightpackage contains many datasets used by data journalists at FiveThirtyEight.com.
IMPORTANT FINAL STEP
- Download the conference materials as a ZIP file and extract the files there as a folder on your computer. Note the importance of actually extracting all the files to a folder. Double click on the gradual_visualization.Rproj file in that folder to open up an RStudio project containing the files needed for the workshop.
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.
- Visualizing continuous data (scatterplots)
- Learning about
- Some basic
- Learning about
- Visualizing categorical data
- More about
- Learning to create small multiple plots using
- More about
- Visualizing categorical versus continuous data (boxplots and violin plots)
- Making your plots interactive using the
ggplotly()function in the