Visualization in R


This repository has teaching materials for a 3 hour, hands-on Visualization in R workshop led at a relaxed pace. The workshop will give participants an overview of the basics of the R package, ggplot2, for the generation of publication-worthy figures. Participants will also use several R packages (ggrepel, pheatmap, etc.) for more advanced plotting methods, such as learning how to change from a wide data format to a long data format for plotting purposes, how to label and/or repel individual data points on a scatter plot, and how to create heatmaps and volcano plots.

Learning Objectives

These materials are developed for a trainer-led workshop, but also amenable to self-guided learning.


Lessons Estimated Duration
Setting up for plotting 15 min
Basic plotting with ggplot2 75 min
Advanced visualizations 90 min

Installation Requirements

Download the most recent versions of R and RStudio for your laptop:

Install the required R packages by running the following code in RStudio:

install.packages(c("ggplot2", "RColorBrewer", "pheatmap", "ggrepel", "reshape"))

Load the libraries to make sure the packages installed properly:


These materials have been developed by members of the teaching team at the Harvard Chan Bioinformatics Core (HBC). These are open access materials distributed under the terms of the Creative Commons Attribution license (CC BY 4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.