class: center, middle, inverse, title-slide .title[ # Exploded code ] .subtitle[ ## Using flipbookr and xaringan ] .author[ ### Me ] --- ```r # This is the recommended set up for flipbooks # you might think about setting cache to TRUE as you gain practice --- building flipbooks from scratch can be time consuming knitr::opts_chunk$set(fig.width = 6, fig.height = 4, message = F, warning = FALSE, comment = "", cache = T) options(tibble.print_min = 55) options(knitr.duplicate.label = "allow") options(width=300) # prevents data wrapping ``` <style type="text/css"> .remark-code{line-height: 1.5; font-size: 70%} @media print { .has-continuation { display: block; } } code.r.hljs.remark-code{ position: relative; overflow-x: hidden; } code.r.hljs.remark-code:hover{ overflow-x:visible; width: 500px; border-style: solid; } </style> --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 2.75 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_01_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 2.8 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_02_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 2.85 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_03_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 2.9 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_04_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 2.95 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_05_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_06_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3.05 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_07_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3.1 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_08_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3.15 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_09_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3.2 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_10_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3.25 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_11_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3.3 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_12_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3.35 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_13_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3.4 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_14_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3.45 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_15_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3.5 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_16_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3.55 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_17_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3.6 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_18_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3.65 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_19_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3.7 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_20_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3.75 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_21_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3.8 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_22_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3.85 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_23_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3.9 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_24_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 3.95 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_25_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 4 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_26_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 4.05 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_27_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 4.1 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_28_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 4.15 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_29_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 4.2 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_30_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 4.25 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_31_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 4.3 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_32_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 4.35 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_33_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 4.4 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_34_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 4.45 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_35_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 4.5 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_36_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 4.55 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_37_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 4.6 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_38_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 4.65 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_39_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 4.7 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_40_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 4.75 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_41_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 4.8 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_42_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 4.85 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_43_output-1.png)<!-- --> ] --- count: false .panel1-cars-replace[ ```r library(tidyverse) *z <- 4.9 tolerance <- .7 mtcars %>% filter(drat < z + tolerance & drat > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- drat))/tolerance) %>% ggplot() + aes(wt, qsec) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = mtcars) + scale_color_viridis_c(limits = range(mtcars$drat)) counter <- 1 ``` ] .panel2-cars-replace[ ![](ggz_flipbook_files/figure-html/cars_replace_44_output-1.png)<!-- --> ] <style> .panel1-cars-replace { color: black; width: 38.6060606060606%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel2-cars-replace { color: black; width: 59.3939393939394%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel3-cars-replace { color: black; width: NA%; hight: 33%; float: left; padding-left: 1%; font-size: 80% } </style> --- ```r read.csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-01-21/spotify_songs.csv") -> songs ``` --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_01_output-1.png)<!-- --> ] --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0.05 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_02_output-1.png)<!-- --> ] --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0.1 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_03_output-1.png)<!-- --> ] --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0.15 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_04_output-1.png)<!-- --> ] --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0.2 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_05_output-1.png)<!-- --> ] --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0.25 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_06_output-1.png)<!-- --> ] --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0.3 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_07_output-1.png)<!-- --> ] --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0.35 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_08_output-1.png)<!-- --> ] --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0.4 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_09_output-1.png)<!-- --> ] --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0.45 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_10_output-1.png)<!-- --> ] --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0.5 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_11_output-1.png)<!-- --> ] --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0.5555 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_12_output-1.png)<!-- --> ] --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0.6 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_13_output-1.png)<!-- --> ] --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0.65 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_14_output-1.png)<!-- --> ] --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0.7 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_15_output-1.png)<!-- --> ] --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0.75 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_16_output-1.png)<!-- --> ] --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0.8 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_17_output-1.png)<!-- --> ] --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0.85 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_18_output-1.png)<!-- --> ] --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0.9 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_19_output-1.png)<!-- --> ] --- count: false .panel1-songs-replace[ ```r library(tidyverse) *z <- 0.95 tolerance <- .1 songs %>% filter(valence < z + tolerance & valence > z - tolerance) %>% mutate(closeness = (tolerance - abs(z- valence))/tolerance) %>% ggplot() + aes(danceability, energy) + geom_point(aes(alpha = closeness, color = z)) + labs(title = paste0("z = ", z,"; tolerance = ", tolerance)) + scale_alpha(limits = c(0, 1)) + geom_blank(data = songs) + scale_color_viridis_c(limits = range(songs$valence)) counter <- 1 ``` ] .panel2-songs-replace[ ![](ggz_flipbook_files/figure-html/songs_replace_20_output-1.png)<!-- --> ] <style> .panel1-songs-replace { color: black; width: 38.6060606060606%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel2-songs-replace { color: black; width: 59.3939393939394%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel3-songs-replace { color: black; width: NA%; hight: 33%; float: left; padding-left: 1%; font-size: 80% } </style>