Data Visualization With R

Homepage for the Data Visualization in R workshop hosted by the Brock University Digital Scholarship Lab

Workshop Splash Image

Making Visualizations with R

In this workshop you will learn the basics of using the ggplot2 package to create visualizations in R. This workshop covers:

A basic understanding of the R programming language is recommended for this workshop.

Estimated length of workshop: 1.5 hours


Setup Instructions

In preparation for this workshop, you will need to have a Posit account (previously was an R Studio Cloud account) and have a new R Studio project open on Posit Cloud. Follow the steps below to get set up.

Source Button Location

Title Change

Tidyverse Install


Workshop Tasks

Task Set #1

  1. Look at the mpg dataset by running mpg. Tidyverse (or at least ggplot2) must be installed and turned on. (use view(mpg) if you want to see the whole dataset)
  2. Read the documentation for the dataset using ?mpg or help(mpg)
  3. Make a point graph, mapping 2 columns of the mpg data as the x and y values.
  4. Try making a few different point graphs using different values and when you are done type “POINT MADE!” in the chat

Task Set #2

  1. Adjust your visualization to change the shape, size, and colour of the entire visualization.
  2. Pick one aesthetic element and use it in your mappings instead to show another column of data in your visualization.
  3. Try different combinations of elements used in your mappings and outside you mappings to see what you get and when you are done type “GOT IT!” in the chat.

Task Set #3

Link to the PDF of the geometry cheat sheet

  1. Create two more visualizations using geometries other than point. Feel free to share your discoveries by pasting your code in the chat.
  2. Once you have finished trying out new geometries, type “DONE!” in the chat.

Task Set #4

  1. Create a visualization with at least 2 geometry layers.
  2. Put the code for your visualization into a variable.
  3. Add a labels layer to the visualization.
  4. Save your visualization as a .jpg file and then type “SAVED!” in the chat.

Follow Up Material

If you are looking to continue enhancing your knowledge of R, check out our other R workshops or try out one of the options below!

R for Data Science

YaRrr! The Pirate’s Guide to R

W3Schools R Tutorial


This workshop is brought to you by the Brock University Digital Scholarship Lab. For a listing of our upcoming workshops go to Experience BU if you are a Brock affiliate or Eventbrite page for external attendees.