class: center, middle, inverse, title-slide .title[ # UN Voting Patterns ] .subtitle[ ## Building a ggplot layer by layer ] --- --- count: false .panel1-un_plot-auto[ ``` r *us_uk_turkey_votes ``` ] .panel2-un_plot-auto[ ``` ## # A tibble: 1,212 × 4 ## country year issue percent_yes ## <chr> <dbl> <fct> <dbl> ## 1 Turkey 1946 Colonialism 0.8 ## 2 Turkey 1946 Economic development 0.6 ## 3 Turkey 1946 Human rights 0 ## 4 Turkey 1947 Colonialism 0.222 ## 5 Turkey 1947 Economic development 0.5 ## 6 Turkey 1947 Palestinian conflict 0.143 ## 7 Turkey 1948 Colonialism 0.417 ## 8 Turkey 1948 Arms control and disarmament 0 ## 9 Turkey 1948 Economic development 0.375 ## 10 Turkey 1948 Human rights 0.167 ## # ℹ 1,202 more rows ``` ] --- count: false .panel1-un_plot-auto[ ``` r us_uk_turkey_votes %>% * ggplot() ``` ] .panel2-un_plot-auto[ <img src="unvotes_demo_files/figure-html/un_plot_auto_02_output-1.png" width="648" /> ] --- count: false .panel1-un_plot-auto[ ``` r us_uk_turkey_votes %>% ggplot() + * aes(x = year) ``` ] .panel2-un_plot-auto[ <img src="unvotes_demo_files/figure-html/un_plot_auto_03_output-1.png" width="648" /> ] --- count: false .panel1-un_plot-auto[ ``` r us_uk_turkey_votes %>% ggplot() + aes(x = year) + * aes(y = percent_yes) ``` ] .panel2-un_plot-auto[ <img src="unvotes_demo_files/figure-html/un_plot_auto_04_output-1.png" width="648" /> ] --- count: false .panel1-un_plot-auto[ ``` r us_uk_turkey_votes %>% ggplot() + aes(x = year) + aes(y = percent_yes) + * aes(color = country) ``` ] .panel2-un_plot-auto[ <img src="unvotes_demo_files/figure-html/un_plot_auto_05_output-1.png" width="648" /> ] --- count: false .panel1-un_plot-auto[ ``` r us_uk_turkey_votes %>% ggplot() + aes(x = year) + aes(y = percent_yes) + aes(color = country) + * geom_point(alpha = 0.4) ``` ] .panel2-un_plot-auto[ <img src="unvotes_demo_files/figure-html/un_plot_auto_06_output-1.png" width="648" /> ] --- count: false .panel1-un_plot-auto[ ``` r us_uk_turkey_votes %>% ggplot() + aes(x = year) + aes(y = percent_yes) + aes(color = country) + geom_point(alpha = 0.4) + * geom_smooth(method = "loess", se = FALSE) ``` ] .panel2-un_plot-auto[ <img src="unvotes_demo_files/figure-html/un_plot_auto_07_output-1.png" width="648" /> ] --- count: false .panel1-un_plot-auto[ ``` r us_uk_turkey_votes %>% ggplot() + aes(x = year) + aes(y = percent_yes) + aes(color = country) + geom_point(alpha = 0.4) + geom_smooth(method = "loess", se = FALSE) + * facet_wrap(~issue) ``` ] .panel2-un_plot-auto[ <img src="unvotes_demo_files/figure-html/un_plot_auto_08_output-1.png" width="648" /> ] --- count: false .panel1-un_plot-auto[ ``` r us_uk_turkey_votes %>% ggplot() + aes(x = year) + aes(y = percent_yes) + aes(color = country) + geom_point(alpha = 0.4) + geom_smooth(method = "loess", se = FALSE) + facet_wrap(~issue) + * labs( * title = "Percentage of 'Yes' votes in the UN General Assembly", * subtitle = "1946 to 2019", * y = "% Yes", * x = "Year", * color = "Country" * ) ``` ] .panel2-un_plot-auto[ <img src="unvotes_demo_files/figure-html/un_plot_auto_09_output-1.png" width="648" /> ] --- count: false .panel1-un_plot-auto[ ``` r us_uk_turkey_votes %>% ggplot() + aes(x = year) + aes(y = percent_yes) + aes(color = country) + geom_point(alpha = 0.4) + geom_smooth(method = "loess", se = FALSE) + facet_wrap(~issue) + labs( title = "Percentage of 'Yes' votes in the UN General Assembly", subtitle = "1946 to 2019", y = "% Yes", x = "Year", color = "Country" ) + * scale_y_continuous(labels = label_percent()) ``` ] .panel2-un_plot-auto[ <img src="unvotes_demo_files/figure-html/un_plot_auto_10_output-1.png" width="648" /> ] <style> .panel1-un_plot-auto { color: black; width: 38.6060606060606%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel2-un_plot-auto { color: black; width: 59.3939393939394%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel3-un_plot-auto { color: black; width: NA%; hight: 33%; float: left; padding-left: 1%; font-size: 80% } </style> --- # Key takeaways - The US votes "Yes" less frequently than the UK and Turkey on most issues - All three countries show distinct trends over time - Human rights and colonialism show the most divergence