library(tidyverse)
library(targets)
library(scales)
library(patchwork)
library(here)

# Generated via random.org
set.seed(8316)

# Load data
# Need to use this withr thing because tar_read() and tar_load() need to see the
# _targets folder in the current directory, but this .Rmd file is in a subfolder
withr::with_dir(here::here(), {
  source(tar_read(plot_funs))
  
  tar_load(survey_results)
  tar_load(sim_excel_final)
  tar_load(sim_final)
  tar_load(giving_aggregate)
  tar_load(giving_per_capita)
})

General demographics of recipients

Religion

religion_lookup <- tribble(
  ~Q5.10, ~religion,
  1, "Catholic",
  2, "Protestant",
  3, "Christian Orthodox",
  4, "Jewish",
  5, "Muslim",
  6, "Sikh",
  7, "Hindu",
  8, "Buddhist",
  9, "Atheist",
  10, "Other"
)

n_respondents <- nrow(survey_results)

religions <- survey_results %>% 
  count(Q5.10) %>% 
  left_join(religion_lookup, by = "Q5.10") %>% 
  arrange(n) %>% 
  mutate(religion = fct_inorder(religion)) %>% 
  mutate(percent = n / n_respondents)

ggplot(religions, aes(x = n, y = religion)) +
  geom_col(fill = clrs_okabe_ito$reddish_purple) +
  scale_x_continuous(sec.axis = sec_axis(~. / n_respondents, labels = percent)) +
  labs(x = "Number of respondents", y = NULL) +
  theme_ngo()

religion_others <- survey_results %>% 
  filter(!is.na(Q5.10_TEXT)) %>% 
  mutate(Q5.10_TEXT = str_to_lower(Q5.10_TEXT)) %>% 
  count(Q5.10_TEXT) %>% 
  arrange(desc(n))
religion_others
## # A tibble: 91 x 2
##    Q5.10_TEXT               n
##    <chr>                <int>
##  1 christian               34
##  2 agnostic                21
##  3 none                    18
##  4 spiritual                9
##  5 baptist                  8
##  6 born again christian     4
##  7 pagan                    4
##  8 wiccan                   4
##  9 lds                      3
## 10 methodist                3
## # … with 81 more rows

Simulations

Income across issue area, funding, and relationship

plot_income_issue <- sim_final %>% 
  group_by(org_issue, persona_income) %>% 
  summarize(avg_share = mean(share)) %>% 
  mutate(facet = "Issue area") %>% 
  ggplot(aes(y = fct_rev(str_wrap_factor(org_issue, 15)),
             x = avg_share, color = fct_rev(persona_income))) +
  geom_pointrange(size = 0.75, fatten = 1.5,
                  aes(xmin = 0, xmax = ..x..), position = position_dodge(width = 0.5)) + 
  scale_x_continuous(labels = percent_format(accuracy = 1), expand = expansion(add = c(0, 0.002)),
                     breaks = seq(0, 0.06, 0.02)) +
  scale_color_manual(values = clrs_ngo_pairs[[1]], guide = FALSE) +
  coord_cartesian(xlim = c(0, 0.06)) +
  labs(x = "Average donation share", y = NULL, color = NULL) +
  facet_wrap(vars(facet)) +
  theme_ngo() +
  theme(panel.grid.major.y = element_blank())

plot_income_funding <- sim_final %>% 
  group_by(org_funding, persona_income) %>% 
  summarize(avg_share = mean(share)) %>% 
  mutate(facet = "Funding sources") %>% 
  ggplot(aes(y = fct_rev(str_wrap_factor(org_funding, 10)), 
             x = avg_share, color = fct_rev(persona_income))) +
  geom_pointrange(size = 0.75, fatten = 1.5,
                  aes(xmin = 0, xmax = ..x..), position = position_dodge(width = 0.5)) + 
  scale_x_continuous(labels = percent_format(accuracy = 1), expand = expansion(add = c(0, 0.002))) +
  coord_cartesian(xlim = c(0, 0.06)) +
  scale_color_manual(values = clrs_ngo_pairs[[1]], guide = FALSE) +
  labs(x = "Average donation share", y = NULL, color = NULL) +
  facet_wrap(vars(facet)) +
  theme_ngo() +
  theme(panel.grid.major.y = element_blank())

plot_income_relationship <- sim_final %>% 
  mutate(persona_income = fct_recode(persona_income,
                                     "< $61,372/year" = "Lower income",
                                     "> $61,372/year" = "Higher income")) %>% 
  group_by(org_relationship, persona_income) %>% 
  summarize(avg_share = mean(share)) %>% 
  mutate(facet = "Relationship with host government") %>% 
  ggplot(aes(y = fct_rev(str_wrap_factor(org_relationship, 10)), 
             x = avg_share, color = fct_rev(persona_income))) +
  geom_pointrange(size = 0.75, fatten = 1.5, 
                  aes(xmin = 0, xmax = ..x..), position = position_dodge(width = 0.5)) +
  scale_x_continuous(labels = percent_format(accuracy = 1), expand = expansion(add = c(0, 0.003))) +
  coord_cartesian(xlim = c(0, 0.1)) +
  scale_color_manual(values = clrs_ngo_pairs[[1]], 
                     guide = guide_legend(reverse = TRUE, nrow = 1,
                                          override.aes = list(size = 0.25,
                                                              linetype = 0))) +
  labs(x = "Average donation share", y = NULL, color = NULL) +
  facet_wrap(vars(str_wrap(facet, 50))) +
  theme_ngo() +
  theme(panel.grid.major.y = element_blank(),
        legend.key.width = unit(0.5, "lines"))

plot_income_relationship_extreme <- sim_excel_final %>% 
  mutate(persona_income = fct_recode(persona_income,
                                     "$50,000/year" = "Lower income",
                                     "$100,000/year" = "Higher income"),
         org_relationship = fct_recode(org_relationship,
                                       "Under crackdown" = "Crackdown")) %>% 
  group_by(org_relationship, persona_income) %>% 
  summarize(avg_share = mean(share)) %>% 
  mutate(facet = "Relationship with host government") %>% 
  ggplot(aes(y = fct_rev(str_wrap_factor(org_relationship, 10)), 
             x = avg_share, color = fct_rev(persona_income))) +
  geom_pointrange(size = 0.75, fatten = 1.5, linetype = "21", pch = 2,
                  aes(xmin = 0, xmax = ..x..), position = position_dodge(width = 0.5)) + 
  scale_x_continuous(labels = percent_format(accuracy = 1), expand = expansion(add = c(0, 0.002))) +
  coord_cartesian(xlim = c(0, 0.1)) +
  scale_color_manual(values = clrs_ngo_pairs[[1]], 
                     guide = guide_legend(reverse = TRUE, nrow = 1,
                                          override.aes = list(size = 0.25, 
                                                              linetype = 0))) +
  labs(x = "Average donation share", y = NULL, color = NULL) +
  facet_wrap(vars(str_wrap(facet, 50))) +
  theme_ngo() +
  theme(panel.grid.major.y = element_blank(),
        legend.key.width = unit(0.5, "lines"))

plot_income <- ((plot_income_issue + labs(x = NULL)) + 
  (plot_income_funding + labs(x = NULL))) / 
  (plot_income_relationship + plot_income_relationship_extreme)

plot_income

Education across issue area, funding, and relationship

plot_education_issue <- sim_final %>% 
  group_by(org_issue, persona_education) %>% 
  summarize(avg_share = mean(share)) %>% 
  mutate(facet = "Issue area") %>% 
  ggplot(aes(y = fct_rev(str_wrap_factor(org_issue, 15)), 
             x = avg_share, color = fct_rev(persona_education))) +
  geom_pointrange(size = 0.75, fatten = 1.5,
                  aes(xmin = 0, xmax = ..x..), position = position_dodge(width = 0.5)) + 
  scale_x_continuous(labels = percent_format(accuracy = 1), expand = expansion(add = c(0, 0.002))) +
  coord_cartesian(xlim = c(0, 0.06)) +
  scale_color_manual(values = clrs_ngo_pairs[[2]], guide = FALSE) +
  labs(x = "Average donation share", y = NULL, color = NULL) +
  facet_wrap(vars(facet)) +
  theme_ngo() +
  theme(panel.grid.major.y = element_blank())

plot_education_funding <- sim_final %>% 
  group_by(org_funding, persona_education) %>% 
  summarize(avg_share = mean(share)) %>% 
  mutate(facet = "Funding sources") %>% 
  ggplot(aes(y = fct_rev(str_wrap_factor(org_funding, 10)), 
             x = avg_share, color = fct_rev(persona_education))) +
  geom_pointrange(size = 0.75, fatten = 1.5,
                  aes(xmin = 0, xmax = ..x..), position = position_dodge(width = 0.5)) + 
  scale_x_continuous(labels = percent_format(accuracy = 1), expand = expansion(add = c(0, 0.002))) +
  coord_cartesian(xlim = c(0, 0.06)) +
  scale_color_manual(values = clrs_ngo_pairs[[2]], guide = FALSE) +
  labs(x = "Average donation share", y = NULL, color = NULL) +
  facet_wrap(vars(facet)) +
  theme_ngo() +
  theme(panel.grid.major.y = element_blank())

plot_education_relationship <- sim_final %>% 
  group_by(org_relationship, persona_education) %>% 
  summarize(avg_share = mean(share)) %>% 
  mutate(facet = "Relationship with host government") %>% 
  ggplot(aes(y = fct_rev(str_wrap_factor(org_relationship, 10)),
             x = avg_share, color = fct_rev(persona_education))) +
  geom_pointrange(size = 0.75, fatten = 1.5,
                  aes(xmin = 0, xmax = ..x..), position = position_dodge(width = 0.5)) + 
  scale_x_continuous(labels = percent_format(accuracy = 1), expand = expansion(add = c(0, 0.002))) +
  coord_cartesian(xlim = c(0, 0.1)) +
  scale_color_manual(values = clrs_ngo_pairs[[2]], 
                     guide = guide_legend(reverse = TRUE, ncol = 1,
                                          override.aes = list(size = 0.25,
                                                              linetype = 0)),
                     labels = label_wrap(15)) +
  labs(x = "Average donation share", y = NULL, color = NULL) +
  facet_wrap(vars(str_wrap(facet, 20))) +
  theme_ngo() +
  theme(panel.grid.major.y = element_blank(),
        legend.key.width = unit(0.5, "lines"))

plot_education <- plot_education_issue + plot_education_funding + 
  plot_education_relationship + guide_area() +
  plot_layout(guides = "collect", ncol = 4)
plot_education

Religiosity across issue area, funding, and relationship

plot_religion_issue <- sim_final %>% 
  group_by(org_issue, persona_religion) %>% 
  summarize(avg_share = mean(share)) %>% 
  mutate(facet = "Issue area") %>% 
  ggplot(aes(y = fct_rev(str_wrap_factor(org_issue, 15)), 
             x = avg_share, color = fct_rev(persona_religion))) +
  geom_pointrange(size = 0.75, fatten = 1.5, pch = 17,
                  aes(xmin = 0, xmax = ..x..), position = position_dodge(width = 0.5)) + 
  scale_x_continuous(labels = percent_format(accuracy = 1), expand = expansion(add = c(0, 0.002))) +
  coord_cartesian(xlim = c(0, 0.06)) +
  scale_color_manual(values = clrs_ngo_pairs[[4]], guide = FALSE) +
  labs(x = "Average donation share", y = NULL, color = NULL) +
  facet_wrap(vars(facet)) +
  theme_ngo() +
  theme(panel.grid.major.y = element_blank())

plot_religion_funding <- sim_final %>% 
  group_by(org_funding, persona_religion) %>% 
  summarize(avg_share = mean(share)) %>% 
  mutate(facet = "Funding sources") %>% 
  ggplot(aes(y = fct_rev(str_wrap_factor(org_funding, 10)), 
             x = avg_share, color = fct_rev(persona_religion))) +
  geom_pointrange(size = 0.75, fatten = 1.5, pch = 17,
                  aes(xmin = 0, xmax = ..x..), position = position_dodge(width = 0.5)) + 
  scale_x_continuous(labels = percent_format(accuracy = 1), expand = expansion(add = c(0, 0.002))) +
  coord_cartesian(xlim = c(0, 0.06)) +
  scale_color_manual(values = clrs_ngo_pairs[[4]], guide = FALSE) +
  labs(x = "Average donation share", y = NULL, color = NULL) +
  facet_wrap(vars(facet)) +
  theme_ngo() +
  theme(panel.grid.major.y = element_blank())

plot_religion_relationship <- sim_final %>% 
  group_by(org_relationship, persona_religion) %>% 
  summarize(avg_share = mean(share)) %>% 
  mutate(facet = "Relationship with host government") %>% 
  ggplot(aes(y = fct_rev(str_wrap_factor(org_relationship, 10)), 
             x = avg_share, color = fct_rev(persona_religion))) +
  geom_pointrange(size = 0.75, fatten = 1.5, pch = 17,
                  aes(xmin = 0, xmax = ..x..), position = position_dodge(width = 0.5)) + 
  scale_x_continuous(labels = percent_format(accuracy = 1), expand = expansion(add = c(0, 0.002))) +
  coord_cartesian(xlim = c(0, 0.1)) +
  scale_color_manual(values = clrs_ngo_pairs[[4]], 
                     guide = guide_legend(reverse = TRUE, ncol = 1,
                                          override.aes = list(size = 0.25,
                                                              linetype = 0)),
                     labels = label_wrap(20)) +
  labs(x = "Average donation share", y = NULL, color = NULL) +
  facet_wrap(vars(str_wrap(facet, 20))) +
  theme_ngo() +
  theme(panel.grid.major.y = element_blank(),
        legend.key.width = unit(0.5, "lines"))

plot_religion <- plot_religion_issue + plot_religion_funding + 
  plot_religion_relationship + guide_area() +
  plot_layout(guides = "collect", ncol = 4)
plot_religion

Education and religion across issue area, funding, and relationship

plot_education_religion <- (plot_education_issue + labs(x = NULL)) + 
  (plot_education_funding + labs(x = NULL)) + 
  (plot_education_relationship + labs(x = NULL)) + 
  guide_area() +
  plot_religion_issue + 
  plot_religion_funding + 
  plot_religion_relationship +
  plot_layout(guides = "collect", ncol = 4)

plot_education_religion

Social trust across issue area

plot_issue_social <- sim_final %>% 
  group_by(org_issue, persona_trust, persona_ideology, persona_experience) %>% 
  summarize(avg_share = mean(share)) %>% 
  ggplot(aes(y = fct_rev(str_wrap_factor(org_issue, 15)), 
             x = avg_share, color = persona_trust)) +
  geom_pointrange(size = 0.75, fatten = 1.5, 
                  aes(xmin = 0, xmax = ..x..), position = position_dodge(width = 0.5)) + 
  scale_x_continuous(labels = percent_format(accuracy = 1), expand = expansion(add = c(0, 0.002))) +
  scale_color_manual(values = clrs_ngo_pairs[[3]], 
                     guide = guide_legend(reverse = TRUE,
                                          override.aes = list(size = 0.25,
                                                              linetype = 0))) +
  labs(x = "Average share of donations", y = NULL, color = NULL) +
  facet_grid(rows = vars(persona_ideology), cols = vars(str_wrap(persona_experience, 100))) +
  theme_ngo() +
  theme(panel.grid.major.y = element_blank(),
        legend.key.width = unit(0.5, "lines"))

plot_issue_social

Social trust across relationship

plot_relationship_social <- sim_final %>% 
  group_by(org_relationship, persona_trust, persona_ideology, persona_experience) %>% 
  summarize(avg_share = mean(share)) %>% 
  ggplot(aes(y = fct_rev(str_wrap_factor(org_relationship, 10)), 
             x = avg_share, color = persona_trust)) +
  geom_pointrange(size = 0.75, fatten = 1.5,
                  aes(xmin = 0, xmax = ..x..), position = position_dodge(width = 0.5)) + 
  scale_x_continuous(labels = percent_format(accuracy = 1), expand = expansion(add = c(0, 0.002))) +
  scale_color_manual(values = clrs_ngo_pairs[[3]], 
                     guide = guide_legend(reverse = TRUE,
                                          override.aes = list(size = 0.25,
                                                              linetype = 0))) +
  labs(x = "Average share of donations", y = NULL, color = NULL) +
  facet_grid(rows = vars(persona_ideology), cols = vars(str_wrap(persona_experience, 100))) +
  theme_ngo() +
  theme(panel.grid.major.y = element_blank(),
        legend.key.width = unit(0.5, "lines"))

plot_relationship_social

Social trust across funding

plot_funding_social <- sim_final %>% 
  group_by(org_funding, persona_trust, persona_ideology, persona_experience) %>% 
  summarize(avg_share = mean(share)) %>% 
  ggplot(aes(y = fct_rev(str_wrap_factor(org_funding, 15)), 
             x = avg_share, color = persona_trust)) +
  geom_pointrange(size = 0.75, fatten = 1.5,
                  aes(xmin = 0, xmax = ..x..), position = position_dodge(width = 0.5)) + 
  scale_x_continuous(labels = percent_format(accuracy = 1), expand = expansion(add = c(0, 0.002))) +
  scale_color_manual(values = clrs_ngo_pairs[[3]], 
                     guide = guide_legend(reverse = TRUE,
                                          override.aes = list(size = 0.25,
                                                              linetype = 0))) +
  labs(x = "Average share of donations", y = NULL, color = NULL) +
  facet_grid(rows = vars(persona_ideology), cols = vars(str_wrap(persona_experience, 100))) +
  theme_ngo() +
  theme(panel.grid.major.y = element_blank(),
        legend.key.width = unit(0.5, "lines"))

plot_funding_social


Original computing environment

devtools::session_info()
## ─ Session info ─────────────────────────────────────────────────────────────────────────
##  setting  value                       
##  version  R version 4.0.3 (2020-10-10)
##  os       macOS Big Sur 10.16         
##  system   x86_64, darwin17.0          
##  ui       X11                         
##  language (EN)                        
##  collate  en_US.UTF-8                 
##  ctype    en_US.UTF-8                 
##  tz       America/New_York            
##  date     2021-04-21                  
## 
## ─ Packages ─────────────────────────────────────────────────────────────────────────────
##  ! package     * version date       lib source        
##  P assertthat    0.2.1   2019-03-21 [?] CRAN (R 4.0.0)
##  P backports     1.2.1   2020-12-09 [?] CRAN (R 4.0.2)
##  P broom         0.7.5   2021-02-19 [?] CRAN (R 4.0.2)
##  P bslib         0.2.4   2021-01-25 [?] CRAN (R 4.0.2)
##  P cachem        1.0.4   2021-02-13 [?] CRAN (R 4.0.2)
##    callr         3.6.0   2021-03-28 [1] CRAN (R 4.0.2)
##  P cellranger    1.1.0   2016-07-27 [?] CRAN (R 4.0.0)
##    cli           2.4.0   2021-04-05 [1] CRAN (R 4.0.2)
##  P codetools     0.2-18  2020-11-04 [?] CRAN (R 4.0.2)
##  P colorspace    2.0-0   2020-11-11 [?] CRAN (R 4.0.2)
##  P crayon        1.4.1   2021-02-08 [?] CRAN (R 4.0.2)
##  P data.table    1.14.0  2021-02-21 [?] CRAN (R 4.0.2)
##  P DBI           1.1.1   2021-01-15 [?] CRAN (R 4.0.2)
##  P dbplyr        2.1.0   2021-02-03 [?] CRAN (R 4.0.2)
##  P desc          1.3.0   2021-03-05 [?] CRAN (R 4.0.2)
##    devtools      2.4.0   2021-04-07 [1] CRAN (R 4.0.2)
##  P digest        0.6.27  2020-10-24 [?] CRAN (R 4.0.2)
##  P dplyr       * 1.0.5   2021-03-05 [?] CRAN (R 4.0.2)
##  P ellipsis      0.3.1   2020-05-15 [?] CRAN (R 4.0.0)
##  P evaluate      0.14    2019-05-28 [?] CRAN (R 4.0.0)
##  P fansi         0.4.2   2021-01-15 [?] CRAN (R 4.0.2)
##  P farver        2.1.0   2021-02-28 [?] CRAN (R 4.0.2)
##  P fastmap       1.1.0   2021-01-25 [?] CRAN (R 4.0.2)
##  P forcats     * 0.5.1   2021-01-27 [?] CRAN (R 4.0.2)
##  P fs            1.5.0   2020-07-31 [?] CRAN (R 4.0.2)
##  P generics      0.1.0   2020-10-31 [?] CRAN (R 4.0.2)
##  P ggplot2     * 3.3.3   2020-12-30 [?] CRAN (R 4.0.2)
##  P glue          1.4.2   2020-08-27 [?] CRAN (R 4.0.2)
##  P gtable        0.3.0   2019-03-25 [?] CRAN (R 4.0.0)
##  P haven         2.3.1   2020-06-01 [?] CRAN (R 4.0.2)
##  P here        * 1.0.1   2020-12-13 [?] CRAN (R 4.0.2)
##  P highr         0.8     2019-03-20 [?] CRAN (R 4.0.0)
##  P hms           1.0.0   2021-01-13 [?] CRAN (R 4.0.2)
##  P htmltools     0.5.1.1 2021-01-22 [?] CRAN (R 4.0.2)
##  P httr          1.4.2   2020-07-20 [?] CRAN (R 4.0.2)
##  P igraph        1.2.6   2020-10-06 [?] CRAN (R 4.0.2)
##  P jquerylib     0.1.3   2020-12-17 [?] CRAN (R 4.0.2)
##  P jsonlite      1.7.2   2020-12-09 [?] CRAN (R 4.0.2)
##  P knitr         1.31    2021-01-27 [?] CRAN (R 4.0.2)
##  P labeling      0.4.2   2020-10-20 [?] CRAN (R 4.0.2)
##  P lifecycle     1.0.0   2021-02-15 [?] CRAN (R 4.0.2)
##  P lubridate     1.7.10  2021-02-26 [?] CRAN (R 4.0.2)
##  P magrittr      2.0.1   2020-11-17 [?] CRAN (R 4.0.2)
##  P memoise       2.0.0   2021-01-26 [?] CRAN (R 4.0.2)
##  P modelr        0.1.8   2020-05-19 [?] CRAN (R 4.0.2)
##  P munsell       0.5.0   2018-06-12 [?] CRAN (R 4.0.0)
##  P patchwork   * 1.1.1   2020-12-17 [?] CRAN (R 4.0.2)
##  P pillar        1.5.1   2021-03-05 [?] CRAN (R 4.0.2)
##  P pkgbuild      1.2.0   2020-12-15 [?] CRAN (R 4.0.2)
##  P pkgconfig     2.0.3   2019-09-22 [?] CRAN (R 4.0.0)
##    pkgload       1.2.1   2021-04-06 [1] CRAN (R 4.0.2)
##  P prettyunits   1.1.1   2020-01-24 [?] CRAN (R 4.0.0)
##  P processx      3.5.1   2021-04-04 [?] CRAN (R 4.0.2)
##  P ps            1.6.0   2021-02-28 [?] CRAN (R 4.0.2)
##  P purrr       * 0.3.4   2020-04-17 [?] CRAN (R 4.0.0)
##  P R6            2.5.0   2020-10-28 [?] CRAN (R 4.0.2)
##  P Rcpp          1.0.6   2021-01-15 [?] CRAN (R 4.0.2)
##  P readr       * 1.4.0   2020-10-05 [?] CRAN (R 4.0.2)
##  P readxl        1.3.1   2019-03-13 [?] CRAN (R 4.0.0)
##    remotes       2.3.0   2021-04-01 [1] CRAN (R 4.0.2)
##    renv          0.13.0  2021-02-24 [1] CRAN (R 4.0.2)
##  P reprex        1.0.0   2021-01-27 [?] CRAN (R 4.0.2)
##  P rlang         0.4.10  2020-12-30 [?] CRAN (R 4.0.2)
##  P rmarkdown     2.7     2021-02-19 [?] CRAN (R 4.0.2)
##  P rprojroot     2.0.2   2020-11-15 [?] CRAN (R 4.0.2)
##  P rstudioapi    0.13    2020-11-12 [?] CRAN (R 4.0.2)
##  P rvest         1.0.0   2021-03-09 [?] CRAN (R 4.0.2)
##  P sass          0.3.1   2021-01-24 [?] CRAN (R 4.0.2)
##  P scales      * 1.1.1   2020-05-11 [?] CRAN (R 4.0.0)
##  P sessioninfo   1.1.1   2018-11-05 [?] CRAN (R 4.0.0)
##  P stringi       1.5.3   2020-09-09 [?] CRAN (R 4.0.2)
##  P stringr     * 1.4.0   2019-02-10 [?] CRAN (R 4.0.0)
##  P targets     * 0.2.0   2021-02-27 [?] CRAN (R 4.0.2)
##  P testthat      3.0.2   2021-02-14 [?] CRAN (R 4.0.2)
##  P tibble      * 3.1.0   2021-02-25 [?] CRAN (R 4.0.2)
##  P tidyr       * 1.1.3   2021-03-03 [?] CRAN (R 4.0.2)
##  P tidyselect    1.1.0   2020-05-11 [?] CRAN (R 4.0.0)
##  P tidyverse   * 1.3.0   2019-11-21 [?] CRAN (R 4.0.0)
##  P usethis       2.0.1   2021-02-10 [?] CRAN (R 4.0.2)
##  P utf8          1.1.4   2018-05-24 [?] CRAN (R 4.0.0)
##  P vctrs         0.3.7   2021-03-29 [?] CRAN (R 4.0.2)
##  P withr         2.4.1   2021-01-26 [?] CRAN (R 4.0.2)
##  P xfun          0.22    2021-03-11 [?] CRAN (R 4.0.2)
##  P xml2          1.3.2   2020-04-23 [?] CRAN (R 4.0.0)
##  P yaml          2.2.1   2020-02-01 [?] CRAN (R 4.0.0)
## 
## [1] /Users/andrew/Dropbox (Personal)/Research collaboration/Global policy special issue/renv/library/R-4.0/x86_64-apple-darwin17.0
## [2] /private/var/folders/4d/ynkkj1nj0yj0lt91mkw2mq100000gn/T/Rtmp0tLEGE/renv-system-library
## 
##  P ── Loaded and on-disk path mismatch.
writeLines(readLines(file.path(Sys.getenv("HOME"), ".R/Makevars")))
## # http://dirk.eddelbuettel.com/blog/2017/11/27/#011_faster_package_installation_one
## VER=
## CCACHE=ccache
## CC=$(CCACHE) gcc$(VER)
## CXX=$(CCACHE) g++$(VER)
## CXX11=$(CCACHE) g++$(VER)
## CXX14=$(CCACHE) g++$(VER)
## FC=$(CCACHE) gfortran$(VER)
## F77=$(CCACHE) gfortran$(VER)
## 
## CXX14FLAGS=-O3 -march=native -mtune=native -fPIC
LS0tCnRpdGxlOiAiQW5hbHlzaXMgYW5kIGZpZ3VyZXMiCmF1dGhvcjogIlN1cGFybmEgQ2hhdWRocnksIE1hcmMgRG90c29uLCBhbmQgQW5kcmV3IEhlaXNzIgpkYXRlOiAiTGFzdCBydW46IGByIGZvcm1hdChTeXMudGltZSgpLCAnJUYnKWAiCm91dHB1dDogCiAgaHRtbF9kb2N1b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4bWF4ID0gLi54Li4pLCBwb3NpdGlvbiA9IHBvc2l0aW9uX2RvZGdlKHdpZHRoID0gMC41KSkgKwogIHNjYWxlX3hfY29udGludW91cyhsYWJlbHMgPSBwZXJjZW50X2Zvcm1hdChhY2N1cmFjeSA9IDEpLCBleHBhbmQgPSBleHBhbnNpb24oYWRkID0gYygwLCAwLjAwMykpKSArCiAgY29vcmRfY2FydGVzaWFuKHhsaW0gPSBjKDAsIDAuMSkpICsKICBzY2FsZV9jb2xvcl9tYW51YWwodmFsdWVzID0gY2xyc19uZ29fcGFpcnNbWzFdXSwgCiAgICAgICAgICAgICAgICAgICAgIGd1aWRlID0gZ3VpZGVfbGVnZW5kKHJldmVyc2UgPSBUUlVFLCBucm93ID0gMSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcnJpZGUuYWVzID0gbGlzdChzaXplID0gMC4yNSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5ldHlwZSA9IDApKSkgKwogIGxhYnMoeCA9ICJBdmVyYWdlIGRvbmF0aW9uIHNoYXJlIiwgeSA9IE5VTEwsIGNvbG9yID0gTlVMTCkgKwogIGZhY2V0X3dyYXAodmFycyhzdHJfd3JhcChmYWNldCwgNTApKSkgKwogIHRoZW1lX25nbygpICsKICB0aGVtZShwYW5lbC5ncmlkLm1ham9yLnkgPSBlbGVtZW50X2JsYW5rKCksCiAgICAgICAgbGVnZW5kLmtleS53aWR0aCA9IHVuaXQoMC41LCAibGluZXMiKSkKCnBsb3RfaW5jb21lX3JlbGF0aW9uc2hpcF9leHRyZW1lIDwtIHNpbV9leGNlbF9maW5hbCAlPiUgCiAgbXV0YXRlKHBlcnNvbmFfaW5jb21lID0gZmN0X3JlY29kZShwZXJzb25hX2luY29tZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIkNTAsMDAwL3llYXIiID0gIkxvd2VyIGluY29t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ICB4ID0gYXZnX3NoYXJlLCBjb2xvciA9IGZjdF9yZXYocGVyc29uYV9yZWxpZ2lvbikpKSArCiAgZ2VvbV9wb2ludHJhbmdlKHNpemUgPSAwLjc1LCBmYXR0ZW4gPSAxLjUsIHBjaCA9IDE3LAogICAgICAgICAgICAgICAgICBhZXMoeG1pbiA9IDAsIHhtYXggPSAuLnguLiksIHBvc2l0aW9uID0gcG9zaXRpb25fZG9kZ2Uod2lkdGggPSAwLjUpKSArIAogIHNjYWxlX3hfY29udGludW91cyhsYWJlbHMgPSBwZXJjZW50X2Zvcm1hdChhY2N1cmFjeSA9IDEpLCBleHBhbmQgPSBleHBhbnNpb24oYWRkID0gYygwLCAwLjAwMikpKSArCiAgY29vcmRfY2FydGVzaWFuKHhsaW0gPSBjKDAsIDAuMSkpICsKICBzY2FsZV9jb2xvcl9tYW51YWwodmFsdWVzID0gY2xyc19uZ29fcGFpcnNbWzRdXSwgCiAgICAgICAgICAgICAgICAgICAgIGd1aWRlID0gZ3VpZGVfbGVnZW5kKHJldmVyc2UgPSBUUlVFLCBuY29sID0gMSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcnJpZGUuYWVzID0gbGlzdChzaXplID0gMC4yNSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5ldHlwZSA9IDApKSwKICAgICAgICAgICAgICAgICAgICAgbGFiZWxzID0gbGFiZWxfd3JhcCgyMCkpICsKICBsYWJzKHggPSAiQXZlcmFnZSBkb25hdGlvbiBzaGFyZSIsIHkgPSBOVUxMLCBjb2xvciA9IE5VTEwpICsKICBmYWNldF93cmFwKHZhcnMoc3RyX3dyYXAoZmFjZXQsIDIwKSkpICsKICB0aGVtZV9uZ28oKSArCiAgdGhlbWUocGFuZWwuZ3JpZC5tYWpvci55ID0gZWxlbWVudF9ibGFuaygpLAogICAgICAgIGxlZ2VuZC5rZXkud2lkdGggPSB1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GluZywgcGVyc29uYV90cnVzdCwgcGVyc29uYV9pZGVvbG9neSwgcGVyc29uYV9leHBlcmllbmNlKSAlPiUgCiAgc3VtbWFyaXplKGF2Z19zaGFyZSA9IG1lYW4oc2hhcmUpKSAlPiUgCiAgZ2dwbG90KGFlcyh5ID0gZmN0X3JldihzdHJfd3JhcF9mYWN0b3Iob3JnX2Z1bmRpbmcsIDE1KSksIAogICAgICAgICAgICAgeCA9IGF2Z19zaGFyZSwgY29sb3IgPSBwZXJzb25hX3RydXN0KSkgKwogIGdlb21fcG9pbnRyYW5nZShzaXplID0gMC43NSwgZmF0dGVuID0gMS41LAogICAgICAgICAgICAgICAgICBhZXMoeG1pbiA9IDAsIHhtYXggPSAuLnguLiksIHBvc2l0aW9uID0gcG9zaXRpb25fZG9kZ2Uod2lkdGggPSAwLjUpKSArIAogIHNjYWxlX3hfY29udGludW91cyhsYWJlbHMgPSBwZXJjZW50X2Zvcm1hdChhY2N1cmFjeSA9IDEpLCBleHBhbmQgPSBleHBhbnNpb24oYWRkID0gYygwLCAwLjAwMikpKSArCiAgc2NhbGVfY29sb3JfbWFudWFsKHZhbHVlcyA9IGNscnNfbmdvX3BhaXJzW1szXV0sIAogICAgICAgICAgICAgICAgICAgICBndWlkZSA9IGd1aWRlX2xlZ2VuZChyZXZlcnNlID0gVFJVRSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcnJpZGUuYWVzID0gbGlzdChzaXplID0gMC4yNSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5ldHlwZSA9IDApKSkgKwogIGxhYnMoeCA9ICJBdmVyYWdlIHNoYXJlIG9mIGRvbmF0aW9ucyIsIHkgPSBOVUxMLCBjb2xvciA9IE5VTEwpICsKICBmYWNldF9ncmlkKHJvd3MgPSB2YXJzKHBlcnNvbmFfaWRlb2xvZ3kpLCBjb2xzID0gdmFycyhzdHJfd3JhcChw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