class: left, top, inverse background-image: url(https://images.unsplash.com/photo-1586165368502-1bad197a6461?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1126&q=80) background-size: cover # .large[Logicals, TRUE-FALSE] ### Walk-throughs <br>with {flipbookr}<br>and {xaringan} <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> #### .right[Gina Reynolds<br>Photo Credit: Hassan Pasha] --- --- count: false .panel1-simple_comparisons-auto[ ```r *5 == 5 ``` ] .panel2-simple_comparisons-auto[ ``` [1] TRUE ``` ] --- count: false .panel1-simple_comparisons-auto[ ```r 5 == 5 *5 != 5 ``` ] .panel2-simple_comparisons-auto[ ``` [1] TRUE ``` ``` [1] FALSE ``` ] --- count: false .panel1-simple_comparisons-auto[ ```r 5 == 5 5 != 5 *5 != 9 ``` ] .panel2-simple_comparisons-auto[ ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ] --- count: false .panel1-simple_comparisons-auto[ ```r 5 == 5 5 != 5 5 != 9 *"blue" == "blue" ``` ] .panel2-simple_comparisons-auto[ ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] TRUE ``` ] --- count: false .panel1-simple_comparisons-auto[ ```r 5 == 5 5 != 5 5 != 9 "blue" == "blue" *"red" == "blue" ``` ] .panel2-simple_comparisons-auto[ ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] TRUE ``` ``` [1] FALSE ``` ] --- count: false .panel1-simple_comparisons-auto[ ```r 5 == 5 5 != 5 5 != 9 "blue" == "blue" "red" == "blue" *"Blue" == "blue" ``` ] .panel2-simple_comparisons-auto[ ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] FALSE ``` ] --- count: false .panel1-simple_comparisons-auto[ ```r 5 == 5 5 != 5 5 != 9 "blue" == "blue" "red" == "blue" "Blue" == "blue" *"Blue" != "blue" ``` ] .panel2-simple_comparisons-auto[ ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ] --- count: false .panel1-simple_comparisons-auto[ ```r 5 == 5 5 != 5 5 != 9 "blue" == "blue" "red" == "blue" "Blue" == "blue" "Blue" != "blue" *5 > 3 ``` ] .panel2-simple_comparisons-auto[ ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] TRUE ``` ] --- count: false .panel1-simple_comparisons-auto[ ```r 5 == 5 5 != 5 5 != 9 "blue" == "blue" "red" == "blue" "Blue" == "blue" "Blue" != "blue" 5 > 3 *5 >= 5 ``` ] .panel2-simple_comparisons-auto[ ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] TRUE ``` ``` [1] TRUE ``` ] --- count: false .panel1-simple_comparisons-auto[ ```r 5 == 5 5 != 5 5 != 9 "blue" == "blue" "red" == "blue" "Blue" == "blue" "Blue" != "blue" 5 > 3 5 >= 5 *5 < 3 ``` ] .panel2-simple_comparisons-auto[ ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] TRUE ``` ``` [1] TRUE ``` ``` [1] FALSE ``` ] --- count: false .panel1-simple_comparisons-auto[ ```r 5 == 5 5 != 5 5 != 9 "blue" == "blue" "red" == "blue" "Blue" == "blue" "Blue" != "blue" 5 > 3 5 >= 5 5 < 3 *5 <= 3 ``` ] .panel2-simple_comparisons-auto[ ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] TRUE ``` ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] FALSE ``` ] <style> .panel1-simple_comparisons-auto { color: black; width: 38.6060606060606%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel2-simple_comparisons-auto { color: black; width: 59.3939393939394%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel3-simple_comparisons-auto { color: black; width: NA%; hight: 33%; float: left; padding-left: 1%; font-size: 80% } </style> --- count: false .panel1-combining_logicals-auto[ ```r *TRUE & TRUE ``` ] .panel2-combining_logicals-auto[ ``` [1] TRUE ``` ] --- count: false .panel1-combining_logicals-auto[ ```r TRUE & TRUE *FALSE & TRUE ``` ] .panel2-combining_logicals-auto[ ``` [1] TRUE ``` ``` [1] FALSE ``` ] --- count: false .panel1-combining_logicals-auto[ ```r TRUE & TRUE FALSE & TRUE *TRUE | FALSE ``` ] .panel2-combining_logicals-auto[ ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ] --- count: false .panel1-combining_logicals-auto[ ```r TRUE & TRUE FALSE & TRUE TRUE | FALSE *FALSE | FALSE ``` ] .panel2-combining_logicals-auto[ ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] FALSE ``` ] --- count: false .panel1-combining_logicals-auto[ ```r TRUE & TRUE FALSE & TRUE TRUE | FALSE FALSE | FALSE *5 %in% c(1, 5, 8, 9) ``` ] .panel2-combining_logicals-auto[ ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ] --- count: false .panel1-combining_logicals-auto[ ```r TRUE & TRUE FALSE & TRUE TRUE | FALSE FALSE | FALSE 5 %in% c(1, 5, 8, 9) *2 %in% c(1, 5, 8, 9) ``` ] .panel2-combining_logicals-auto[ ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] FALSE ``` ] --- count: false .panel1-combining_logicals-auto[ ```r 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) ``` ] .panel2-combining_logicals-auto[ ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] FALSE TRUE ``` ] --- count: false .panel1-combining_logicals-auto[ ```r 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 ``` ] .panel2-combining_logicals-auto[ ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] TRUE ``` ``` [1] FALSE ``` ``` [1] FALSE TRUE ``` ``` [1] FALSE TRUE FALSE FALSE ``` ] <style> .panel1-combining_logicals-auto { color: black; width: 38.6060606060606%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel2-combining_logicals-auto { color: black; width: 59.3939393939394%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel3-combining_logicals-auto { color: black; width: NA%; hight: 33%; float: left; padding-left: 1%; font-size: 80% } </style> --- count: false .panel1-in_a_pipeline-auto[ ```r *library(gapminder) ``` ] .panel2-in_a_pipeline-auto[ ] --- count: false .panel1-in_a_pipeline-auto[ ```r library(gapminder) *library(tidyverse) ``` ] .panel2-in_a_pipeline-auto[ ``` ── Attaching packages ──────────────────────── tidyverse 1.3.0 ── ``` ``` ✓ ggplot2 3.3.2 ✓ purrr 0.3.3 ✓ tibble 3.0.0 ✓ dplyr 1.0.2 ✓ tidyr 1.0.2 ✓ stringr 1.4.0 ✓ readr 1.3.1 ✓ forcats 0.5.0 ``` ``` Warning: package 'ggplot2' was built under R version 3.6.2 ``` ``` Warning: package 'tibble' was built under R version 3.6.2 ``` ``` Warning: package 'dplyr' was built under R version 3.6.2 ``` ``` ── Conflicts ─────────────────────────── tidyverse_conflicts() ── x dplyr::filter() masks stats::filter() x dplyr::lag() masks stats::lag() ``` ] --- count: false .panel1-in_a_pipeline-auto[ ```r library(gapminder) library(tidyverse) *gapminder ``` ] .panel2-in_a_pipeline-auto[ ``` # A tibble: 1,704 x 6 country continent year lifeExp pop gdpPercap <fct> <fct> <int> <dbl> <int> <dbl> 1 Afghanistan Asia 1952 28.8 8425333 779. 2 Afghanistan Asia 1957 30.3 9240934 821. 3 Afghanistan Asia 1962 32.0 10267083 853. 4 Afghanistan Asia 1967 34.0 11537966 836. 5 Afghanistan Asia 1972 36.1 13079460 740. 6 Afghanistan Asia 1977 38.4 14880372 786. 7 Afghanistan Asia 1982 39.9 12881816 978. 8 Afghanistan Asia 1987 40.8 13867957 852. 9 Afghanistan Asia 1992 41.7 16317921 649. 10 Afghanistan Asia 1997 41.8 22227415 635. # … with 1,694 more rows ``` ] --- count: false .panel1-in_a_pipeline-auto[ ```r library(gapminder) library(tidyverse) gapminder %>% * filter(pop > 100000000 & * gdpPercap > 5000) ``` ] .panel2-in_a_pipeline-auto[ ``` # A tibble: 30 x 6 country continent year lifeExp pop gdpPercap <fct> <fct> <int> <dbl> <int> <dbl> 1 Brazil Americas 1977 61.5 114313951 6660. 2 Brazil Americas 1982 63.3 128962939 7031. 3 Brazil Americas 1987 65.2 142938076 7807. 4 Brazil Americas 1992 67.1 155975974 6950. 5 Brazil Americas 1997 69.4 168546719 7958. 6 Brazil Americas 2002 71.0 179914212 8131. 7 Brazil Americas 2007 72.4 190010647 9066. 8 Japan Asia 1967 71.4 100825279 9848. 9 Japan Asia 1972 73.4 107188273 14779. 10 Japan Asia 1977 75.4 113872473 16610. # … with 20 more rows ``` ] --- count: false .panel1-in_a_pipeline-auto[ ```r library(gapminder) library(tidyverse) gapminder %>% filter(pop > 100000000 & gdpPercap > 5000) %>% * filter(year > 1995) ``` ] .panel2-in_a_pipeline-auto[ ``` # A tibble: 11 x 6 country continent year lifeExp pop gdpPercap <fct> <fct> <int> <dbl> <int> <dbl> 1 Brazil Americas 1997 69.4 168546719 7958. 2 Brazil Americas 2002 71.0 179914212 8131. 3 Brazil Americas 2007 72.4 190010647 9066. 4 Japan Asia 1997 80.7 125956499 28817. 5 Japan Asia 2002 82 127065841 28605. 6 Japan Asia 2007 82.6 127467972 31656. 7 Mexico Americas 2002 74.9 102479927 10742. 8 Mexico Americas 2007 76.2 108700891 11978. 9 United States Americas 1997 76.8 272911760 35767. 10 United States Americas 2002 77.3 287675526 39097. 11 United States Americas 2007 78.2 301139947 42952. ``` ] --- count: false .panel1-in_a_pipeline-auto[ ```r library(gapminder) library(tidyverse) gapminder %>% filter(pop > 100000000 & gdpPercap > 5000) %>% filter(year > 1995) %>% * filter(country == "Brazil" | * country == "Mexico" | * country == "United States") ``` ] .panel2-in_a_pipeline-auto[ ``` # A tibble: 8 x 6 country continent year lifeExp pop gdpPercap <fct> <fct> <int> <dbl> <int> <dbl> 1 Brazil Americas 1997 69.4 168546719 7958. 2 Brazil Americas 2002 71.0 179914212 8131. 3 Brazil Americas 2007 72.4 190010647 9066. 4 Mexico Americas 2002 74.9 102479927 10742. 5 Mexico Americas 2007 76.2 108700891 11978. 6 United States Americas 1997 76.8 272911760 35767. 7 United States Americas 2002 77.3 287675526 39097. 8 United States Americas 2007 78.2 301139947 42952. ``` ] --- count: false .panel1-in_a_pipeline-auto[ ```r library(gapminder) library(tidyverse) gapminder %>% filter(pop > 100000000 & gdpPercap > 5000) %>% filter(year > 1995) %>% filter(country == "Brazil" | country == "Mexico" | country == "United States") %>% * filter(country %in% c("United States", * "Mexico")) ``` ] .panel2-in_a_pipeline-auto[ ``` # A tibble: 5 x 6 country continent year lifeExp pop gdpPercap <fct> <fct> <int> <dbl> <int> <dbl> 1 Mexico Americas 2002 74.9 102479927 10742. 2 Mexico Americas 2007 76.2 108700891 11978. 3 United States Americas 1997 76.8 272911760 35767. 4 United States Americas 2002 77.3 287675526 39097. 5 United States Americas 2007 78.2 301139947 42952. ``` ] <style> .panel1-in_a_pipeline-auto { color: black; width: 38.6060606060606%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel2-in_a_pipeline-auto { color: black; width: 59.3939393939394%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel3-in_a_pipeline-auto { color: black; width: NA%; hight: 33%; float: left; padding-left: 1%; font-size: 80% } </style> <style type="text/css"> .remark-code{line-height: 1.5; font-size: 80%} @media print { .has-continuation { display: block; } } </style>