-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbooleans.Rmd
82 lines (62 loc) · 1.32 KB
/
booleans.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
---
title: "Booleans"
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("simple_comparisons")`
```{r simple_comparisons, include = F}
5 == 5
5 != 5
5 != 9
"blue" == "blue"
"red" == "blue"
"Blue" == "blue"
"Blue" != "blue"
5 > 3
5 >= 5
5 < 3
5 <= 3
```
---
`r flipbookr::chunk_reveal("combining_logicals")`
```{r combining_logicals, include = F}
TRUE & TRUE
FALSE & TRUE
TRUE | FALSE
FALSE | FALSE
5 %in% c(1, 5, 8, 9)
2 %in% c(1, 5, 8, 9)
c(2, 5) %in% c(1, 5, 8, 9)
c(1, 5, 8, 9) %in% 5
```
---
`r flipbookr::chunk_reveal("in_a_pipeline")`
```{r in_a_pipeline, include = F}
gapminder %>%
filter(pop > 100000000 &
gdpPercap > 5000) %>%
filter(year > 1995) %>%
filter(country == "Brazil" |
country == "Mexico" |
country == "United States") %>%
filter(country %in% c("United States", "Mexico"))
```
```{css, eval = TRUE, echo = FALSE}
.remark-code{line-height: 1.5; font-size: 70%}
```