Join GitHub today
"Supercharge your plotting in R using ggplot2" by Bruno Grande #143
There are several approaches to plotting available in R: base graphics, lattice and ggplot2, just to name a few. In recent years, ggplot2 has truly taken off to become one of the most popular visualization packages in R. It leverages the grammar of graphics to deliver an intuitive framework to build plots and other graphics.
This workshop will cover the basics of plotting in R using ggplot2 We will learn how to build scatterplots, strip plots, barplots, histograms and other density plots. We will also touch upon various customizations for polishing your plots and preparing them to be published. I will assume that attendees are familiar with R. Please read the installation instructions ahead of the workshop.
Time and Place
Where: Room 7010, Library Research Commons, SFU Burnaby Campus
When: Tuesday, October 25th @ 3:00 pm
Because of time constraints, I expect attendees to be familiar with R. For instance, they should know what data frames are and how to manipulate them.
As I mentioned above, I expect attendees to be familiar with R. Therefore, you should already have R installed on your laptop.
I recommend that you install RStudio if you don't have it already. It's an integrated development environment (IDE) specifically made for R. I will be using RStudio in my workshop.
Tidyverse (including ggplot2)
I recommend that you install the suite of tools developed by Hadley Wickam, appropriately called the
To do so, Hadley released a convenience package that installs all of the above packages and more in one command:
If you just want to install ggplot2, run the following command instead:
For this workshop, we will be using Jenny Bryan's gapminder R package, which bundles up a subset of the full gapminder dataset. We will be exploring this data during the workshop. You can install the package as follows:
Lessons Notes: https://github.com/jennybc/ggplot2-tutorial
Code: https://gist.github.com/brunogrande/b9f572676e811282d168a23babc12fbc (courtesy of Michelle Jones)