class: center, middle, inverse, title-slide # The Tidyverse, Part 2 ## “R is not in some far-off place.” ### Otho Mantegazza
2019-11-20 --- class: blueblue, middle .big[You are already .orange[exploring data] using summary statistics.] .big[Could we learn more turning them into visual representation?] --- count: false .pull-left-reveal[ ```r *squirrels_tidy ``` ] .pull-right-reveal[ ``` ## # A tibble: 3,023 x 36 ## long lat unique_squirrel… hectare shift ## <dbl> <dbl> <chr> <chr> <chr> ## 1 -74.0 40.8 37F-PM-1014-03 37F PM ## 2 -74.0 40.8 37E-PM-1006-03 37E PM ## 3 -74.0 40.8 2E-AM-1010-03 02E AM ## 4 -74.0 40.8 5D-PM-1018-05 05D PM ## 5 -74.0 40.8 39B-AM-1018-01 39B AM ## 6 -74.0 40.8 33H-AM-1019-02 33H AM ## 7 -74.0 40.8 6G-PM-1020-02 06G PM ## 8 -74.0 40.8 35C-PM-1013-03 35C PM ## 9 -74.0 40.8 7B-AM-1008-09 07B AM ## 10 -74.0 40.8 32E-PM-1017-14 32E PM ## # … with 3,013 more rows, and 31 more variables: ## # date <date>, hectare_squirrel_number <dbl>, ## # age <chr>, primary_fur_color <chr>, ## # highlight_fur_color <chr>, ## # combination_of_primary_and_highlight_color <chr>, ## # color_notes <chr>, location <chr>, height <dbl>, ## # specific_location <chr>, running <lgl>, ## # chasing <lgl>, climbing <lgl>, eating <lgl>, ## # foraging <lgl>, other_activities <chr>, ## # kuks <lgl>, quaas <lgl>, moans <lgl>, ## # tail_flags <lgl>, … ``` ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% * drop_na(height) ``` ] .pull-right-reveal[ ``` ## # A tibble: 2,909 x 36 ## long lat unique_squirrel… hectare shift ## <dbl> <dbl> <chr> <chr> <chr> ## 1 -74.0 40.8 37E-PM-1006-03 37E PM ## 2 -74.0 40.8 2E-AM-1010-03 02E AM ## 3 -74.0 40.8 5D-PM-1018-05 05D PM ## 4 -74.0 40.8 33H-AM-1019-02 33H AM ## 5 -74.0 40.8 6G-PM-1020-02 06G PM ## 6 -74.0 40.8 35C-PM-1013-03 35C PM ## 7 -74.0 40.8 7B-AM-1008-09 07B AM ## 8 -74.0 40.8 36H-AM-1010-02 36H AM ## 9 -74.0 40.8 33F-AM-1008-02 33F AM ## 10 -74.0 40.8 21C-PM-1006-01 21C PM ## # … with 2,899 more rows, and 31 more variables: ## # date <date>, hectare_squirrel_number <dbl>, ## # age <chr>, primary_fur_color <chr>, ## # highlight_fur_color <chr>, ## # combination_of_primary_and_highlight_color <chr>, ## # color_notes <chr>, location <chr>, height <dbl>, ## # specific_location <chr>, running <lgl>, ## # chasing <lgl>, climbing <lgl>, eating <lgl>, ## # foraging <lgl>, other_activities <chr>, ## # kuks <lgl>, quaas <lgl>, moans <lgl>, ## # tail_flags <lgl>, … ``` ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% * ggplot(aes(x = age, * y = height)) ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% ggplot(aes(x = age, y = height)) + * geom_point() ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% ggplot(aes(x = age, y = height)) + geom_point() + * geom_boxplot() ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% ggplot(aes(x = age, y = height)) + geom_point() + geom_boxplot() + * labs(title = "Height Above Ground of Squirrels by Age", * y = "Feet from Ground", * caption = "Data from data.cityofnewyork.us") ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% ggplot(aes(x = age, y = height)) + geom_point() + geom_boxplot() + labs(title = "Height Above Ground of Squirrels by Age", y = "Feet from Ground", caption = "Data from data.cityofnewyork.us") + * theme_gray(base_size = 18) ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% ggplot(aes(x = age, y = height)) + geom_point() + geom_boxplot() + labs(title = "Height Above Ground of Squirrels by Age", y = "Feet from Ground", caption = "Data from data.cityofnewyork.us") + theme_gray(base_size = 18) + * coord_flip() ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% ggplot(aes(x = age, y = height)) + geom_point() + geom_boxplot() + labs(title = "Height Above Ground of Squirrels by Age", y = "Feet from Ground", caption = "Data from data.cityofnewyork.us") + theme_gray(base_size = 18) + coord_flip() + * scale_y_sqrt() ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r *squirrels_tidy ``` ] .pull-right-reveal[ ``` ## # A tibble: 3,023 x 36 ## long lat unique_squirrel… hectare shift ## <dbl> <dbl> <chr> <chr> <chr> ## 1 -74.0 40.8 37F-PM-1014-03 37F PM ## 2 -74.0 40.8 37E-PM-1006-03 37E PM ## 3 -74.0 40.8 2E-AM-1010-03 02E AM ## 4 -74.0 40.8 5D-PM-1018-05 05D PM ## 5 -74.0 40.8 39B-AM-1018-01 39B AM ## 6 -74.0 40.8 33H-AM-1019-02 33H AM ## 7 -74.0 40.8 6G-PM-1020-02 06G PM ## 8 -74.0 40.8 35C-PM-1013-03 35C PM ## 9 -74.0 40.8 7B-AM-1008-09 07B AM ## 10 -74.0 40.8 32E-PM-1017-14 32E PM ## # … with 3,013 more rows, and 31 more variables: ## # date <date>, hectare_squirrel_number <dbl>, ## # age <chr>, primary_fur_color <chr>, ## # highlight_fur_color <chr>, ## # combination_of_primary_and_highlight_color <chr>, ## # color_notes <chr>, location <chr>, height <dbl>, ## # specific_location <chr>, running <lgl>, ## # chasing <lgl>, climbing <lgl>, eating <lgl>, ## # foraging <lgl>, other_activities <chr>, ## # kuks <lgl>, quaas <lgl>, moans <lgl>, ## # tail_flags <lgl>, … ``` ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% * drop_na(height) ``` ] .pull-right-reveal[ ``` ## # A tibble: 2,909 x 36 ## long lat unique_squirrel… hectare shift ## <dbl> <dbl> <chr> <chr> <chr> ## 1 -74.0 40.8 37E-PM-1006-03 37E PM ## 2 -74.0 40.8 2E-AM-1010-03 02E AM ## 3 -74.0 40.8 5D-PM-1018-05 05D PM ## 4 -74.0 40.8 33H-AM-1019-02 33H AM ## 5 -74.0 40.8 6G-PM-1020-02 06G PM ## 6 -74.0 40.8 35C-PM-1013-03 35C PM ## 7 -74.0 40.8 7B-AM-1008-09 07B AM ## 8 -74.0 40.8 36H-AM-1010-02 36H AM ## 9 -74.0 40.8 33F-AM-1008-02 33F AM ## 10 -74.0 40.8 21C-PM-1006-01 21C PM ## # … with 2,899 more rows, and 31 more variables: ## # date <date>, hectare_squirrel_number <dbl>, ## # age <chr>, primary_fur_color <chr>, ## # highlight_fur_color <chr>, ## # combination_of_primary_and_highlight_color <chr>, ## # color_notes <chr>, location <chr>, height <dbl>, ## # specific_location <chr>, running <lgl>, ## # chasing <lgl>, climbing <lgl>, eating <lgl>, ## # foraging <lgl>, other_activities <chr>, ## # kuks <lgl>, quaas <lgl>, moans <lgl>, ## # tail_flags <lgl>, … ``` ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% * filter(height > 0) ``` ] .pull-right-reveal[ ``` ## # A tibble: 792 x 36 ## long lat unique_squirrel… hectare shift ## <dbl> <dbl> <chr> <chr> <chr> ## 1 -74.0 40.8 2E-AM-1010-03 02E AM ## 2 -74.0 40.8 5D-PM-1018-05 05D PM ## 3 -74.0 40.8 11D-AM-1010-03 11D AM ## 4 -74.0 40.8 7H-AM-1006-05 07H AM ## 5 -74.0 40.8 16C-PM-1018-03 16C PM ## 6 -74.0 40.8 17F-AM-1007-07 17F AM ## 7 -74.0 40.8 18A-PM-1018-01 18A PM ## 8 -74.0 40.8 31H-PM-1008-02 31H PM ## 9 -74.0 40.8 8H-AM-1017-06 08H AM ## 10 -74.0 40.8 34F-AM-1007-01 34F AM ## # … with 782 more rows, and 31 more variables: ## # date <date>, hectare_squirrel_number <dbl>, ## # age <chr>, primary_fur_color <chr>, ## # highlight_fur_color <chr>, ## # combination_of_primary_and_highlight_color <chr>, ## # color_notes <chr>, location <chr>, height <dbl>, ## # specific_location <chr>, running <lgl>, ## # chasing <lgl>, climbing <lgl>, eating <lgl>, ## # foraging <lgl>, other_activities <chr>, ## # kuks <lgl>, quaas <lgl>, moans <lgl>, ## # tail_flags <lgl>, … ``` ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% filter(height > 0) %>% * ggplot(aes(x = age, * y = height)) ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% filter(height > 0) %>% ggplot(aes(x = age, y = height)) + * geom_quasirandom() ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% filter(height > 0) %>% ggplot(aes(x = age, y = height)) + geom_quasirandom() + * theme_gray(base_size = 18) ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% filter(height > 0) %>% ggplot(aes(x = age, y = height)) + geom_quasirandom() + theme_gray(base_size = 18) + * labs(title = "Height Above Ground of Squirrels by Age", * y = "Feet from Ground", * caption = "Data from data.cityofnewyork.us") ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% filter(height > 0) %>% ggplot(aes(x = age, y = height)) + geom_quasirandom() + theme_gray(base_size = 18) + labs(title = "Height Above Ground of Squirrels by Age", y = "Feet from Ground", caption = "Data from data.cityofnewyork.us") + * coord_flip() ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% filter(height > 0) %>% ggplot(aes(x = age, y = height)) + geom_quasirandom() + theme_gray(base_size = 18) + labs(title = "Height Above Ground of Squirrels by Age", y = "Feet from Ground", caption = "Data from data.cityofnewyork.us") + coord_flip() + * scale_y_sqrt() ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% filter(height > 0) %>% ggplot(aes(x = age, y = height)) + geom_quasirandom() + theme_gray(base_size = 18) + labs(title = "Height Above Ground of Squirrels by Age", y = "Feet from Ground", caption = "Data from data.cityofnewyork.us") + coord_flip() + scale_y_sqrt() + * stat_summary(fun.y = "median", * geom = "point", * size = 10, * alpha = .9, * colour = "#FF6C0D") ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r *squirrels_tidy ``` ] .pull-right-reveal[ ``` ## # A tibble: 3,023 x 36 ## long lat unique_squirrel… hectare shift ## <dbl> <dbl> <chr> <chr> <chr> ## 1 -74.0 40.8 37F-PM-1014-03 37F PM ## 2 -74.0 40.8 37E-PM-1006-03 37E PM ## 3 -74.0 40.8 2E-AM-1010-03 02E AM ## 4 -74.0 40.8 5D-PM-1018-05 05D PM ## 5 -74.0 40.8 39B-AM-1018-01 39B AM ## 6 -74.0 40.8 33H-AM-1019-02 33H AM ## 7 -74.0 40.8 6G-PM-1020-02 06G PM ## 8 -74.0 40.8 35C-PM-1013-03 35C PM ## 9 -74.0 40.8 7B-AM-1008-09 07B AM ## 10 -74.0 40.8 32E-PM-1017-14 32E PM ## # … with 3,013 more rows, and 31 more variables: ## # date <date>, hectare_squirrel_number <dbl>, ## # age <chr>, primary_fur_color <chr>, ## # highlight_fur_color <chr>, ## # combination_of_primary_and_highlight_color <chr>, ## # color_notes <chr>, location <chr>, height <dbl>, ## # specific_location <chr>, running <lgl>, ## # chasing <lgl>, climbing <lgl>, eating <lgl>, ## # foraging <lgl>, other_activities <chr>, ## # kuks <lgl>, quaas <lgl>, moans <lgl>, ## # tail_flags <lgl>, … ``` ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% * drop_na(height) ``` ] .pull-right-reveal[ ``` ## # A tibble: 2,909 x 36 ## long lat unique_squirrel… hectare shift ## <dbl> <dbl> <chr> <chr> <chr> ## 1 -74.0 40.8 37E-PM-1006-03 37E PM ## 2 -74.0 40.8 2E-AM-1010-03 02E AM ## 3 -74.0 40.8 5D-PM-1018-05 05D PM ## 4 -74.0 40.8 33H-AM-1019-02 33H AM ## 5 -74.0 40.8 6G-PM-1020-02 06G PM ## 6 -74.0 40.8 35C-PM-1013-03 35C PM ## 7 -74.0 40.8 7B-AM-1008-09 07B AM ## 8 -74.0 40.8 36H-AM-1010-02 36H AM ## 9 -74.0 40.8 33F-AM-1008-02 33F AM ## 10 -74.0 40.8 21C-PM-1006-01 21C PM ## # … with 2,899 more rows, and 31 more variables: ## # date <date>, hectare_squirrel_number <dbl>, ## # age <chr>, primary_fur_color <chr>, ## # highlight_fur_color <chr>, ## # combination_of_primary_and_highlight_color <chr>, ## # color_notes <chr>, location <chr>, height <dbl>, ## # specific_location <chr>, running <lgl>, ## # chasing <lgl>, climbing <lgl>, eating <lgl>, ## # foraging <lgl>, other_activities <chr>, ## # kuks <lgl>, quaas <lgl>, moans <lgl>, ## # tail_flags <lgl>, … ``` ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% * filter(height > 0) ``` ] .pull-right-reveal[ ``` ## # A tibble: 792 x 36 ## long lat unique_squirrel… hectare shift ## <dbl> <dbl> <chr> <chr> <chr> ## 1 -74.0 40.8 2E-AM-1010-03 02E AM ## 2 -74.0 40.8 5D-PM-1018-05 05D PM ## 3 -74.0 40.8 11D-AM-1010-03 11D AM ## 4 -74.0 40.8 7H-AM-1006-05 07H AM ## 5 -74.0 40.8 16C-PM-1018-03 16C PM ## 6 -74.0 40.8 17F-AM-1007-07 17F AM ## 7 -74.0 40.8 18A-PM-1018-01 18A PM ## 8 -74.0 40.8 31H-PM-1008-02 31H PM ## 9 -74.0 40.8 8H-AM-1017-06 08H AM ## 10 -74.0 40.8 34F-AM-1007-01 34F AM ## # … with 782 more rows, and 31 more variables: ## # date <date>, hectare_squirrel_number <dbl>, ## # age <chr>, primary_fur_color <chr>, ## # highlight_fur_color <chr>, ## # combination_of_primary_and_highlight_color <chr>, ## # color_notes <chr>, location <chr>, height <dbl>, ## # specific_location <chr>, running <lgl>, ## # chasing <lgl>, climbing <lgl>, eating <lgl>, ## # foraging <lgl>, other_activities <chr>, ## # kuks <lgl>, quaas <lgl>, moans <lgl>, ## # tail_flags <lgl>, … ``` ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% filter(height > 0) %>% * ggplot(aes(x = height)) ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% filter(height > 0) %>% ggplot(aes(x = height)) + * geom_density(fill = "grey40", * alpha = .6, * adjust = 1/2) ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% filter(height > 0) %>% ggplot(aes(x = height)) + geom_density(fill = "grey40", alpha = .6, adjust = 1/2) + * labs(title = "Height Above Ground of Squirrels by Age", * x = "Feet from Ground", * caption = "Data from data.cityofnewyork.us") ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% filter(height > 0) %>% ggplot(aes(x = height)) + geom_density(fill = "grey40", alpha = .6, adjust = 1/2) + labs(title = "Height Above Ground of Squirrels by Age", x = "Feet from Ground", caption = "Data from data.cityofnewyork.us") + * theme_bw(base_size = 18) ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% filter(height > 0) %>% ggplot(aes(x = height)) + geom_density(fill = "grey40", alpha = .6, adjust = 1/2) + labs(title = "Height Above Ground of Squirrels by Age", x = "Feet from Ground", caption = "Data from data.cityofnewyork.us") + theme_bw(base_size = 18) + * facet_grid(age ~ .) ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% filter(height > 0) %>% ggplot(aes(x = height)) + geom_density(fill = "grey40", alpha = .6, adjust = 1/2) + labs(title = "Height Above Ground of Squirrels by Age", x = "Feet from Ground", caption = "Data from data.cityofnewyork.us") + theme_bw(base_size = 18) + facet_grid(age ~ .) + * stat_sum( * aes(y = -.005, * size = 1, * colour = ..n.., * label = "|"), * geom = "text", * fontface = "bold", * show.legend = F) ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% drop_na(height) %>% filter(height > 0) %>% ggplot(aes(x = height)) + geom_density(fill = "grey40", alpha = .6, adjust = 1/2) + labs(title = "Height Above Ground of Squirrels by Age", x = "Feet from Ground", caption = "Data from data.cityofnewyork.us") + theme_bw(base_size = 18) + facet_grid(age ~ .) + stat_sum( aes(y = -.005, size = 1, colour = ..n.., label = "|"), geom = "text", fontface = "bold", show.legend = F) + * scale_colour_viridis_c() ``` ] .pull-right-reveal[ <!-- --> ] --- # GGPLOT2 for Data Visualization .pull-left[ .middle[ GGPLOT2 is a library for graphical representation of Data. - It is widely developed, you can use it to plot almost anything, - It is based on the Layered Grammar of Graphics, - It's designed both for exploratory viz and for communiacation To get used to ggplot you must think in a layered way. ] ] .pull-right[ .center[ </p> <a href="https://ggplot2.tidyverse.org" class="imagelink"> <img src="img/SVG/ggplot2.svg" alt="hex-ggplot" height="445" width="400"></a> <p> ] ] --- class: middle  Image credits: [@dgkeyes](https://twitter.com/dgkeyes), https://rfortherestofus.com/ . Found through [@W_R_Chase](https://twitter.com/W_R_Chase) --- # The Grammar of Graphics You map **data**... 1. to **Aesthetic** properties of objects, 2. according **Scale**, placed on **Coordinates** 3. Those objects are represented by **Geometric Shapes**. 4. You might need to use **statistical** transformations, to highlight those properties, 5. You might want to use **Facets** to represent multiple dimentions --- class: exercise, middle .exercise-title[Exercise:] .exercise-body-small[ Show the number of squirrels by their primary and highlight fur colour in a barchart. - Map the **highlight fur colour** to the **x axis**. Can you make the x axis vertical? - Map the **primary fur colour** to the **fill aesthetic** of the bars. Can you map them to to their real colours? - What are you mapping to the y axis, can you order the bars by their height? ] --- class: exercise, middle .exercise-title[Exercise:] .exercise-body[ Use an histogram to visualize how are the black squirrels distributed along the longitude variable. - If you map the longitude on the x axis, which variable are you mapping on the y axis? - Are you using a statistical transformation? ] --- class: exercise, middle .exercise-title[Exercise:] .exercise-body-small[ Can you show where are the squirrels with a scatterplot? - Map the **longitude** to the **x axis** and the **latitude** to the **y axis**. - Map the colour of the points to the real fur colour of the squirrels. - Can you also split the fur colours in facets? - How can you avoid overplotting? Can you bin the squirrel position on the x and y axis? ] --- count: false .pull-left-reveal[ ```r *squirrels_tidy ``` ] .pull-right-reveal[ ``` ## # A tibble: 3,023 x 36 ## long lat unique_squirrel… hectare shift ## <dbl> <dbl> <chr> <chr> <chr> ## 1 -74.0 40.8 37F-PM-1014-03 37F PM ## 2 -74.0 40.8 37E-PM-1006-03 37E PM ## 3 -74.0 40.8 2E-AM-1010-03 02E AM ## 4 -74.0 40.8 5D-PM-1018-05 05D PM ## 5 -74.0 40.8 39B-AM-1018-01 39B AM ## 6 -74.0 40.8 33H-AM-1019-02 33H AM ## 7 -74.0 40.8 6G-PM-1020-02 06G PM ## 8 -74.0 40.8 35C-PM-1013-03 35C PM ## 9 -74.0 40.8 7B-AM-1008-09 07B AM ## 10 -74.0 40.8 32E-PM-1017-14 32E PM ## # … with 3,013 more rows, and 31 more variables: ## # date <date>, hectare_squirrel_number <dbl>, ## # age <chr>, primary_fur_color <chr>, ## # highlight_fur_color <chr>, ## # combination_of_primary_and_highlight_color <chr>, ## # color_notes <chr>, location <chr>, height <dbl>, ## # specific_location <chr>, running <lgl>, ## # chasing <lgl>, climbing <lgl>, eating <lgl>, ## # foraging <lgl>, other_activities <chr>, ## # kuks <lgl>, quaas <lgl>, moans <lgl>, ## # tail_flags <lgl>, … ``` ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% * ggplot(aes(x = long, * y = lat)) ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% ggplot(aes(x = long, y = lat)) + * geom_point(alpha = .1) ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% ggplot(aes(x = long, y = lat)) + geom_point(alpha = .1) + * geom_hex(colour = "#FFFFFF", * size = .2, * binwidth = c(.0015, * .001)) ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% ggplot(aes(x = long, y = lat)) + geom_point(alpha = .1) + geom_hex(colour = "#FFFFFF", size = .2, binwidth = c(.0015, .001)) + * coord_quickmap() ``` ] .pull-right-reveal[ <!-- --> ] --- count: false .pull-left-reveal[ ```r squirrels_tidy %>% ggplot(aes(x = long, y = lat)) + geom_point(alpha = .1) + geom_hex(colour = "#FFFFFF", size = .2, binwidth = c(.0015, .001)) + coord_quickmap() + * theme_bw() ``` ] .pull-right-reveal[ <!-- --> ]