Materials from my ggplot workshop, ResBaz 2020 and 2021
Beautiful plots with ggplot2
Back to Resbaz List of HackMDs
Being able to create visualizations (graphical representations) of data is a key step in being able to communicate information and findings to others. In this module you will learn to use the ggplot2 library to declaratively make beautiful plots or charts of your data. Learning the framework for using this library will allow you to make nearly any kind of (static) data visualization, customized to your exact specifications. Getting Started
This workshop expects some working basic knowledge of R, RStudio and if possible of the ‘tidyverse’
Installations:
To follow this workshop you’ll need R and Rstudio installed on your computer.
Open RStudio and install the tidyverse libraries by typing install.packages("tidyverse") in the console.
You’ll also need the avocado price dataset available here (but we’ll do this together):
https://www.kaggle.com/neuromusic/avocado-prices/data
What We’ll Cover
The ‘layered’ system of adding plot components (geoms)
The ‘grammar’ of graphics
Plotting dates in a time series
Extras: Add an image (or three) to your plot!
We’ll work as consistently as possible with previous workshops
Introductions
Name, Affiliation, Title, Email, Social Media
Kathryn Busby: UA Entomology and Insect Science, PhD Candidate, [email protected], https://github.com/katbeescience
Questions and Answers
In this section, you can post your questions and feel free to answer if you have it. Questions will be answered during or after the workshop.
Ask your question.
Here is an answer
Further Resources
Here is a list of resources mentioned in this session and beyond:
The code from this workshop: https://github.com/katbeescience/ggplot-viz
A sign-in sheet for participants: https://docs.google.com/spreadsheets/d/1DqpT7-U1XiSEhVT_wpuEEVDII5Lhavm5wRRcDrQiPPk/edit?usp=sharing
Avocado dataset used in this workshop: https://www.kaggle.com/neuromusic/avocado-prices/data
A second link to the avocado dataset: https://docs.google.com/spreadsheets/d/1ZTVsagSH2zpWz9O-8CV68WPlEd95ewL9OmK0vAgVpl8/edit?usp=sharing
R Graph Gallery: https://www.r-graph-gallery.com/ggplot2-package.html
R Color Library: http://www.stat.columbia.edu/~tzheng/files/Rcolor.pdf
List of ggplot themes: https://ggplot2.tidyverse.org/reference/ggtheme.html
ggplot2 documentation: https://ggplot2.tidyverse.org/index.html
THE ggplot Book: https://ggplot2-book.org/index.html
Book: Data Visualization, A Practical Introduction by Kieran Healy. https://socviz.co/index.html#preface
Book: Discovering Statistics in R by Andy Field, Jeremy Miles, and Zoe Field https://www.discoveringstatistics.com/books/discovering-statistics-using-r/
Session Feedback
Use the link below to provide your feedback on the session:
Session Feedback Form