Intro to data visualization with ggplot2


Preface:

This is an introduction to data visualization in R with the ggplot2 package. It is based partially on openly available material from Data Carpentry and EEB313. This lesson covers most standard kinds of plots used in biological research, such as scatter plots, line plots, bar plots, and histograms. The latter half of the lesson addresses intermediate-level techniques in ggplot2, such as facetting and model fitting. Finally, the lesson touches on plot customization using themes.

The lesson assumes knowledge of the material covered in our Intro to R lesson, such as familiarity with the R/RStudio interface, objects and functions, as well as some basic dplyr operations.

We will be working through the material together in RStudio rstudio using the R Notebook r-notebook file format. To use RStudio, you will also have to download standalone R here.

Please make sure to have dplyr, readr, knitr, and ggplot2 installed:

install.packages('dplyr')
install.packages('knitr')
install.packages('ggplot2')

To install dplyr, readr, and ggplot2 all at once alongside other useful R packages:

install.packages('tidyverse')

Lesson Overview:

The lesson covers: