This approximately three hour workshop gives an introduction the
ggplot2
package for newcomers to the
R. Participants are immediately taught to work with R
markdown so that it becomes a natural part of their workflow.
This is a beginner level course aimed at anyone who works with data and has at least some basic knowledge of R, e.g., see:
- Use the workshop presentation (HTML):
- Share the following zip file with the participants:
- ggplot2-Intro.zip
- Ask them to unzip it
The presentation is in three part with three accompanying sets of exercises as follows:
- Exercise 1: Portugal
- Exercise 2: Europe
- Exercise 3: Gapminder plot
Start by presenting the basic ggplot2
concepts using the HTML presentation referenced
above. Before the participants start the first exercise show them how to use R markdown
and go through the first part of "Exercise 1" with them, step by step.
When you get to each of the exercises in the presentation:
- Ask the participant to double click on
Exercises/ggplot2-Exercises.Rproj
from the unzipped location to open Rstudio with the right setup. - Participants should then work through
Exercises/ggplot2-Exercises.Rmd
. - Start by knitting the
Rmd
document.- As the start of the first Exercise ask the participants to change the name to their name and knit again. This usually makes them smile.
Note: Some participants might open the
Exercises/ggplot2-Exercises.Rproj
from within the zip archive which will lead to issues when knitting theExercises/ggplot2-Exercises.Rmd
. Double check that they unzipped the file first and openedExercises/ggplot2-Exercises.Rproj
from the unzipped location.
During the exercises strongly encourage participants to discuss and work together in pairs.
- Share the solutions to the exercises (zip file)
Run the _make.R script in the R console.
It produces elegant graphics by design. It is very flexible allowing you to customise your
plots or add new features (via extensions) to the ggplot2
ecosystem (see https://www.ggplot2-exts.org/gallery/).
ggplot2
is an essential must have package your R tool kit. Be brave give it a go :)
For more information see https://ggplot2.tidyverse.org/
First presented as part of a Data Science Unplugged meetup:
A reminder of annoucements for this repository.
Thanks to Hadley Wickham (author and maintainer) and his co-authors Winston Chang, Lionel Henry, Thomas Lin Pedersen, Kohske Takahashi, Claus Wilke, Kara Woo and RStudio for this great package and many others too.
For a full list of contributors to the ggplot2
package see
https://github.com/tidyverse/ggplot2/graphs/contributors.