forked from EvaMaeRey/tidyverse_in_action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
summarize.Rmd
52 lines (44 loc) · 1.07 KB
/
summarize.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
---
title: "summarize"
subtitle: "made with flipbookr and xaringan"
author: "Gina Reynolds, January 2020"
output:
xaringan::moon_reader:
chakra: libs/remark-latest.min.js
lib_dir: libs
css: [default, hygge, ninjutsu]
nature:
ratio: 16:10
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
---
```{r}
library(gapminder)
library(tidyverse)
knitr::opts_chunk$set(cache = F, comment = "")
```
---
`r flipbookr::chunk_reveal("a_few_more")`
```{r a_few_more, include = F}
gapminder %>%
distinct(country, continent) %>%
# tally and count are the same
count(continent) %>%
rename(count = n) ->
count_in_continents
# another pipeline
gapminder %>%
summarize(mean_life_exp = mean(lifeExp),
median_life_exp = median(lifeExp)) ->
overall_summaries
# another
gapminder %>%
group_by(continent) %>%
summarize(mean_life_exp = mean(lifeExp),
median_life_exp = median(lifeExp)) ->
summaries_by_continent
```
```{css, eval = TRUE, echo = FALSE}
.remark-code{line-height: 1.5; font-size: 70%}
```