forked from DataScience4Psych/DataScience4Psych
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0201_visualization.Rmd
More file actions
219 lines (170 loc) · 5.77 KB
/
0201_visualization.Rmd
File metadata and controls
219 lines (170 loc) · 5.77 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# (PART) Module 02 {-}
```{r include = FALSE}
source("common.R")
ds4p_urls <- read.csv("./admin/csv/ds4p_urls.csv")
```
# Welcome to Data and Visualization
This module is designed to introduce you to exploratory and graphical data analysis.
Please watch the videos and work your way through the notes. **The videos start on the next page.**
You can find the video playlist for this module [here][pl_02]. The slides used to make the videos in this module can be found in the [slides repo][course_slides].
## Module Materials
* Slides from Lectures
* [Data and visualization][d03_dataviz]
* [Visualizing data with ggplot2][d04_ggplot2]
* [Visualizing numerical data][d05_viznum]
* [Visualizing categorical data][d06_vizcat]
* Suggested Readings
* All subchapters of this module, including
* [Basic care and feeding of data in R](#basiccare)
* R4DS
* [Data Exploratation Section](https://r4ds.had.co.nz/explore-intro.html), including
* [Data visualization](https://r4ds.had.co.nz/data-visualization.html)
* [Exploratory Data Analysis](https://r4ds.had.co.nz/exploratory-data-analysis.html)
* Activities
* [Star Wars!][ae03_starwars]
* Lab
* [Plastic waste](#lab02)
### Estimated Video Length
<!-- https://www.youtube.com/playlist?list=PLKrrdtYgOUYZmr_T3PnuxjVIlj0C0kUNI & https://ytplaylist-len.herokuapp.com/ -->
No of videos : 9
Average length of video : 13 minutes, 34 seconds
Total length of playlist : 2 hours, 2 minutes, 11 seconds
# Exploratory Data Analysis
You can follow along with the slides [here][d03_dataviz] if they do not appear below.
```{r, echo=FALSE,eval = knitr::is_latex_output()}
embed_youtube_alt("IUP3qCIjk4Q")
```
```{r, echo=FALSE,eval = knitr::is_html_output()}
"https://www.youtube.com/watch?v=IUP3qCIjk4Q" %>%
embed_url() %>%
use_align("center")
```
```{r, echo=FALSE}
var_url <- slide_url(ds4p_urls, "d03_dataviz")
include_url(var_url[1], height = "400px")
```
## What is in a dataset?
```{r, echo=FALSE,eval = knitr::is_latex_output()}
embed_youtube_alt("J6arziOCQpk")
```
```{r, echo=FALSE,eval = knitr::is_html_output()}
"https://www.youtube.com/watch?v=J6arziOCQpk" %>%
embed_url() %>%
use_align("center")
```
```{r, echo=FALSE}
# is unhappy for some reason
var_url <- slide_url(ds4p_urls, "d03_dataviz", "#23")
include_url(var_url[1], height = "400px")
```
### Why do we visualize?
```{r, echo=FALSE,eval = knitr::is_latex_output()}
embed_youtube_alt("E5IY1FQv0OM")
```
```{r, echo=FALSE,eval = knitr::is_html_output()}
"https://www.youtube.com/watch?v=E5IY1FQv0OM" %>%
embed_url() %>%
use_align("center")
```
```{r, echo=FALSE}
# is unhappy for some reason
var_url <- slide_url(ds4p_urls, "d03_dataviz", "#35")
include_url(var_url[1], height = "400px")
```
# Visualizing data with ggplot2
```{r, echo=FALSE}
"https://twitter.com/valeriepolad/status/1388733898926870533" %>%
try_include_tweet()
"https://twitter.com/_stevenshoe/status/1469332905503731713" %>%
try_include_tweet()
```
You can follow along with the slides [here][d04_ggplot2] if they do not appear below.
```{r, echo=FALSE,eval = knitr::is_latex_output()}
embed_youtube_alt("-tdEQXdx-SA")
```
```{r, echo=FALSE,eval = knitr::is_html_output()}
"https://www.youtube.com/watch?v=-tdEQXdx-SA" %>%
embed_url() %>%
use_align("center")
```
```{r, echo=FALSE}
slide_url(ds4p_urls, "d04_ggplot2") %>%
include_url(height = "400px")
```
## ggplot2 and aesthetics
```{r, echo=FALSE,eval = knitr::is_latex_output()}
embed_youtube_alt("K2u2_lcgdks")
```
```{r, echo=FALSE,eval = knitr::is_html_output()}
"https://www.youtube.com/watch?v=K2u2_lcgdks" %>%
embed_url() %>%
use_align("center")
# Aesthetics
```
```{r, echo=FALSE}
slide_url(ds4p_urls, "d04_ggplot2", "#26") %>%
include_url(height = "400px")
```
# Visualizing numerical data
You can follow along with the slides [here][d05_viznum] if they do not appear below.
```{r, echo=FALSE,eval = knitr::is_latex_output()}
embed_youtube_alt("hGylk9UaM2k")
```
```{r, echo=FALSE,eval = knitr::is_html_output()}
"https://www.youtube.com/watch?v=hGylk9UaM2k" %>%
embed_url() %>%
use_align("center")
```
```{r, echo=FALSE}
slide_url(ds4p_urls, "d05_viznum") %>%
include_url(height = "400px")
```
## Looking at Data
```{r, echo=FALSE,eval = knitr::is_latex_output()}
embed_youtube_alt("sN2gCCd2Rr8")
```
```{r, echo=FALSE,eval = knitr::is_html_output()}
"https://www.youtube.com/watch?v=sN2gCCd2Rr8" %>%
embed_url() %>%
use_align("center")
# Tukey and the Prim9!
```
## More on visualizing numerical data
Fun fact, when you screen capture with [f.lux](https://justgetflux.com/) running in the background, f.lux is captured too.
```{r, echo=FALSE,eval = knitr::is_latex_output()}
embed_youtube_alt("7OWyhBWMoM8")
```
```{r, echo=FALSE,eval = knitr::is_html_output()}
"https://www.youtube.com/watch?v=7OWyhBWMoM8" %>%
embed_url() %>%
use_align("center")
```
```{r, echo=FALSE}
slide_url(ds4p_urls, "d05_viznum", "#12") %>%
include_url(height = "400px")
```
# Visualizing categorical data
You can follow along with the slides [here][d06_vizcat] if they do not appear below.
```{r, echo=FALSE,eval = knitr::is_latex_output()}
embed_youtube_alt("xY819zNKdnY")
```
```{r, echo=FALSE,eval = knitr::is_html_output()}
"https://www.youtube.com/watch?v=xY819zNKdnY" %>%
embed_url() %>%
use_align("center")
```
```{r, echo=FALSE}
slide_url(ds4p_urls, "d06_vizcat") %>%
include_url(height = "400px")
```
# Star Wars Activity
```{r, echo=FALSE}
slide_url(ds4p_urls, "d06_vizcat", "#15") %>%
include_url(height = "400px")
```
You can find the materials for the Star Wars activity [here][ae03_starwars]. The compiled version should look something like the following...
```{r, echo=FALSE}
include_url("https://datascience4psych.github.io/ae-03-starwars-dataviz/starwars.html", height = "400px")
```
```{r links, child="admin/md/courselinks.md"}
```