Overview
- Identify the importance of graphics in communicating information
- Define the layered grammar of graphics
- Demonstrate how to use layered grammar of graphics
- Practice generating layered graphics using
ggplot2
Before class
- Required: read chapter 3 from R for Data Science. You need to read this chapter and complete some of the exercises before coming to class. Exercise solutions can be found here.
- Optional: read Hadley Wickham A Layered Grammar of Graphics – the “pre-print” version of the article can be downloaded for free. This article is optional, but I strongly encourage you to skim through it to familiarize with the theory and language of the grammar of graphics; read especially section 3 “Components of the Layered Grammar” and section 4 “A Hierarchy of Defaults.”
Class materials
Additional resources
Graphical design * Tufte, Edward R. The Visual Display of
Quantitative
Information. Classic
book on statistical graphics and visualization design. * Healey,
Kieran. Data Visualization: A Practical Guide. An
applied introduction to graphical design with lots of applications in
ggplot2 and many code examples.
ggplot2 * ggplot2: Elegant Graphics for Data Analysis, 2nd
Edition – Hadley Wickham. Excellent resource
for learning the intricacies of ggplot2. * Documentation for
ggplot2 * R Graphics
Cookbook, 2nd edition – Winston Chang. A
practical guide with 150 examples to generate quality statistical
graphics based on the data you wish to present.
###Cheatsheets * Data visualization with ggplot2 cheat sheet * RStudio IDE Cheat Sheet * Rmarkdown Cookbook
What you need to do after class
- Complete Homework 1 and submit the link to your repo on Canvas so we can grade it
- Review today’s lecture and prepare for next class
- This applies only if you installed your software
locally:
- Install the
rcislibrary from GitHub. To install it run the commandremotes::install_github("CFSS-MACSS/rcis")in the console. We will be using data from this package in class. - Notice: if you do not already have the
remoteslibrary installed, you will get an error. Go back and install this first usinginstall.packages("remotes"), then runremotes::install_github("CFSS-MACSS/rcis")in the console.
- Install the