-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.Rmd
221 lines (163 loc) · 6.9 KB
/
index.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
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
220
221
---
title: "Machine Learning in R"
subtitle: "Introduction to the Tidyverse"
author: "Simon Schölzel"
institute: "*Research Team Berens*"
date: "Winter Term 2021/2022"
output:
xaringan::moon_reader:
seal: false
css: [./custom/xaringan-themer.css, ./custom/custom-theme.css]
lib_dir: libs
nature:
titleSlideClass: [left, middle, inverse]
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
ratio: '16:9'
---
```{r setup, include=F}
# knitr options
knitr::opts_chunk$set(
comment = ">",
collapse = F
)
# package management
if (!require("pacman")) install.packages("pacman")
pacman::p_load(
xaringanthemer, metathis, palmerpenguins,
tidyverse, magrittr, glue, showtext, plotly, patchwork, ggforce
)
pacman::p_load_gh("hadley/emo", "gadenbuie/countdown", "gadenbuie/xaringanExtra")
# xaringan custom setup
xaringanthemer::style_mono_accent(
base_color = "#000000",
link_color = "#0000EE",
header_font_google = google_font("Josefin Sans"),
text_font_google = google_font("Montserrat", "700b", "400"),
code_font_google = google_font("Fira Mono"),
colors = c(red = "#f34213", white = "#FFFFFF"),
code_font_size = "smaller",
code_inline_background_color = "#F4F4F4",
outfile = "./custom/xaringan-themer.css"
)
xaringanExtra::use_panelset()
xaringanExtra::use_webcam()
xaringanExtra::use_extra_styles(
hover_code_line = T,
mute_unhighlighted_code = T
)
metathis::meta() %>%
meta_name("github-repo" = "simonschoe/introduction-to-the-tidyverse") %>%
meta_social(
title = "Introduction to the Tidyverse",
description = "2 hours introductory workshop on the `tidyverse` meta-package.",
url = "https://simonschoe.github.io/introduction-to-the-tidyverse",
image = "https://simonschoe.github.io/introduction-to-the-tidyverse/img/share-card.png",
image_alt = "Title slide for Introduction to the Tidyverse",
og_type = "website",
og_author = "Simon Schölzel",
twitter_card_type = "summary_large_image"
)
```
```{r, include=F}
countdown::countdown(
minutes = 2, seconds = 0,
left = 0, right = 0, top = 0.5, bottom = 0.5,
padding = "50px",
margin = "7.5%",
font_size = "5em"
)
```
class: center, middle, hide-count
count: false
# `r rmarkdown::metadata$title`
### `r rmarkdown::metadata$subtitle`
___
**`r rmarkdown::metadata$author`**
`r rmarkdown::metadata$date`
.small[(updated: `r Sys.Date()`)]
<br><br>
<a href="https://www.wiwi.uni-muenster.de/"><img src="https://www.wiwi.uni-muenster.de/fakultaet/sites/all/themes/wwucd/assets/images/logos/secondary_wiwi_aacsb_german.jpg" alt="fb4-logo" height="45"></a> <a href="https://www.wiwi.uni-muenster.de/ctrl/aktuelles"><img src="https://www.wiwi.uni-muenster.de/ctrl/sites/all/themes/wwucd/assets/images/logos/berenslogo5.jpg" alt="ftb-logo" height="45"></a> <a href="https://www.wiwi.uni-muenster.de/iff2/de/news"><img src="https://www.wiwi.uni-muenster.de/iff2/sites/all/themes/wwucd/assets/images/logos/logo_iff2_en2.jpg" alt="ipb-logo" height="45"></a>
---
## Agenda
**1 Learning Objectives**
**2 Introduction to the `tidyverse`**
> 2.1 What is the `tidyverse`
2.2 The Concept of Tidy Data
**3 `palmerpenguins`: Palmer Archipelago (Antarctica) Penguin Data**
**4 The Core `tidyverse` Packages**
> 4.1 `magrittr`: A Forward-Pipe Operator for `R`
4.2 `tibble`: Simple Data Frames
4.3 `readr`: Read Rectangular Text Data
4.4 `tidyr`: Tidy Messy Data
4.5 `dplyr`: A Grammar of Data Manipulation
4.6 `purrr`: Functional Programming Tools
4.7 `ggplot2`: Create Elegant Data Visualisations Using the Grammar of Graphics
```{r, echo=F}
xaringanExtra::use_progress_bar(color = "#000066", location = "bottom")
```
---
## 1 Learning Objectives `r emo::ji("idea")`
This lecture teaches you important tools for working with tabular data sets in `R`. It introduces and showcases a suite of packages which ease your data science workflow in terms of data import, data cleaning, data transformation and data visualization.
More specifically, after this lecture you will
- be familiar with the main tools of the `tidyverse` and how it differs from `base R`,<br><br>
- know your way around in working with the core packages of the `tidyverse` for importing, tidying, transforming and visualizing data,<br><br>
- be proficient in processing (*non-tidy*) data of any shape and quality,<br><br>
- be able to produce high-quality, fully customizable visualizations,<br><br>
- have improved your overall data literacy.
???
especially highlight the last point: how you think about data, how you approach working with data whenever you open a new data set, build a mental model for data transformation operations
---
```{r child='./01_intro.Rmd', eval=T}
```
---
```{r child='./02_tidy_data.Rmd', eval=T}
```
---
```{r child='./03_magrittr.Rmd', eval=T}
```
---
```{r child='./04_tibble.Rmd', eval=T}
```
---
```{r child='./05_readr.Rmd', eval=T}
```
---
```{r child='./06_tidyr.Rmd', eval=T}
```
---
```{r child='./07_dplyr.Rmd', eval=T}
```
---
```{r child='./08_purrr.Rmd', eval=T}
```
---
```{r child='./09_ggplot2.Rmd', eval=T}
```
---
## Thank You!
.pull-left[
.center[`r emo::ji("thinking_face")` **Right now**]<br>
```{r, echo=F, fig.align='center'}
knitr::include_graphics("https://tenor.com/view/homer-daydreaming-thinking-simpsons-gif-8949118.gif")
```
]
.pull-right[
.center[`r emo::ji("nerd_face")` **After having mastered the `tidyverse`**]<br><br>
```{r, echo=F, fig.align='center'}
knitr::include_graphics("https://tenor.com/view/homer-gif-10571731.gif")
```
]
.footnote[
*Note: Eventually, not everything is great in the `tidyverse`. You should always be aware of its [downsides](https://github.com/matloff/TidyverseSkeptic/blob/master/READMEFull.md) and know when to return to using `base R`.*
]
---
## Further Resources
**Wickham, H./Grolemund, G. (2017):** R for Data Science: Visualize, Model, Transform, Tidy, and Import Data. URL: https://r4ds.had.co.nz/tidy-data.html. (*Best read for starting in the `tidyverse`*)
**Wickham, H./Navarro, D./Lin Pedersen, T. (2020):** ggplot2: Elegant Graphics for Data Analysis. 3rd. edition, Online Publication 2020. URL: https://ggplot2-book.org/. (*Additional resource for diving deeper into the world of `ggplot2`*)
Stay up-to-date with recent developments in the `tidyverse`: https://www.tidyverse.org/blog/
Watch live-coding sessions related to the [TidyTuesday](https://github.com/rfordatascience/tidytuesday) Project, e.g., the episodes by David Robinson: https://www.youtube.com/user/safe4democracy/videos
## Credits
Educational resources are inspired by [workshop materials](https://github.com/rstudio-education/remaster-the-tidyverse) of Garrett Grolemund and [blog posts](https://education.rstudio.com/blog/2020/07/teaching-the-tidyverse-in-2020-part-1-getting-started/) by Mine Çetinkaya-Rundel of the RStudio Education team.
`tidyverse` [artworks and illustration](https://github.com/allisonhorst/stats-illustrations) are provided by Allison Horst.