forked from cis-ds/course-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cm002.Rmd
62 lines (43 loc) · 3.95 KB
/
cm002.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
title: "Visualizations and the grammar of graphics"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(cache=TRUE)
```
# cm002 - March 28, 2018
## Overview
* Identify the importance of graphics in communicating information
* Define the layered grammar of graphics
* Demonstrate how to use layered grammar of graphics to build Minard's graph of Napoleon's invasion of Russia
* Practice generating layered graphics using [`ggplot2`](https://github.com/hadley/ggplot2)
## Before class
* Read chapters 1-4 from [R for Data Science](http://r4ds.had.co.nz/)
* Chapters 1, 2, and 4 are very short but set the stage for the next few weeks
* Chapter 3 is crucial - you need to read this chapter and complete some of the exercises before coming to class. Exercise solutions can be found [here](https://jrnold.github.io/r4ds-exercise-solutions/).
* Read [The grammar of graphics](dataviz_grammar_of_graphics.html)
* If you have additional time, also read/skim [A Layered Grammar of Graphics](http://www-tandfonline-com.proxy.uchicago.edu/doi/abs/10.1198/jcgs.2009.07098)
* [Install and setup software](setup00.html)
* Definitely have R and RStudio installed and operational for class today
* If you haven't gotten GitHub setup yet, that's fine but you will need it to complete [homework 1](hw01-edit-README.html)
## Slides and class materials
* [Slides](extras/cm002_slides.html)
* [Why visualize data?](dataviz_why.html)
* [How to build a complicated, layered graphic](dataviz_minard.html)
* [Practice generating layered graphics using `ggplot2`](dataviz_gapminder.html)
* [Exploring Minard's 1812 plot with `ggplot2`](https://github.com/andrewheiss/fancy-minard) - a much fancier (and more complex) version
## Additional resources
### Graphical design
* [Tufte, Edward R. *The Visual Display of Quantitative Information*.](https://www.edwardtufte.com/tufte/books_vdqi) Classic book on statistical graphics and visualization design.
### `ggplot2`
* [ggplot2: Elegant Graphics for Data Analysis, 2nd Edition](http://link.springer.com.proxy.uchicago.edu/book/10.1007/978-3-319-24277-4) -- Hadley Wickham. Excellent resource for learning the intricacies of `ggplot2`.
* [Documentation for ggplot2](http://docs.ggplot2.org/current/)
* Why do we learn the `ggplot2` graphics library and not the base [`graphics`](https://cran.r-project.org/web/views/Graphics.html) system? David Robinson explains it well in [Don't teach built-in plotting to beginners (teach ggplot2)](http://varianceexplained.org/r/teach_ggplot2_to_beginners/), and follows up with a longer defense of `ggplot2` in [Why I use ggplot2](http://varianceexplained.org/r/why-I-use-ggplot2/)
### Useful cheatsheets
* [Data visualization with ggplot2 cheat sheet](https://www.rstudio.com/wp-content/uploads/2015/03/ggplot2-cheatsheet.pdf)
* [RStudio IDE Cheat Sheet](https://www.rstudio.com/wp-content/uploads/2016/01/rstudio-IDE-cheatsheet.pdf) - if you don't know what all the buttons and panels do in RStudio, this is a great decoder
## What you need to do
* [Register your GitHub username for the course](https://goo.gl/forms/AI8bJOZv0niNzhPA2) - all remaining homework assignments will be in **private repositories**. Private repos can only be seen and edited by members of our [course organization](https://github.com/uc-cfss). Once you register your GitHub account, I will invite you to join the course organization. If you don't register your account, you won't have access to any of the homework assignments.
* [Complete homework 1](hw01-edit-README.html)
* Install the [`rcfss`](https://github.com/uc-cfss/rcfss) library from GitHub. To install the package, run the command `devtools::install_github("uc-cfss/rcfss")` in the console. We will be using data from this package in class next week.
> If you do not already have the `devtools` library installed, you will get an error. Go back and install this first using `install.packages("devtools")`, then run `devtools::install_github("uc-cfss/rcfss")` in the console.