forked from cis-ds/course-site
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcm002.Rmd
More file actions
50 lines (33 loc) · 3.13 KB
/
cm002.Rmd
File metadata and controls
50 lines (33 loc) · 3.13 KB
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
---
title: "Visualizations and the grammar of graphics"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(cache=TRUE)
```
# cm002 - January 9, 2017
## 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)
## Slides and links
* [The grammar of graphics](block002_grammar_of_graphics.html)
* [Slides](extras/cm002_slides.html)
* Chapters 1-4 from [R for Data Science](http://r4ds.had.co.nz/)
#### Graphical design and R
* [Tufte, Edward R. *The Visual Display of Quantitative Information*.](https://www.edwardtufte.com/tufte/books_vdqi) Classic book on statistical graphics and visualization design.
* Wickham, Hadley. (2010). [A Layered Grammar of Graphics.](http://www-tandfonline-com.proxy.uchicago.edu/doi/abs/10.1198/jcgs.2009.07098) *Journal of Computational and Statistical Graphics*.
#### 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
## To do for Wednesday
* [Register your GitHub account for the class](https://goo.gl/forms/ByirWtGNQdIVYjP82) - 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)
* Read chapters 5-8 from [R for Data Science](http://r4ds.had.co.nz/)
* 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 on Wednesday.
> If you don't 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")`.