@@ -639,7 +639,7 @@ As a final point, we note that these distributions weigh every country the same.
639
639
gapminder %>%
640
640
filter(year %in% c(past_year, present_year) & country %in% country_list) %>%
641
641
group_by(year) %>%
642
- mutate(weight = population/sum(population)*2 ) %>%
642
+ mutate(weight = population/sum(population)) %>%
643
643
ungroup() %>%
644
644
ggplot(aes(dollars_per_day, fill = group, weight = weight)) +
645
645
scale_x_continuous(trans = "log2") +
@@ -684,7 +684,7 @@ This shows a dramatic difference. While in the west less than 0.5% children die,
684
684
685
685
``` {r}
686
686
surv_income %>% ggplot(aes(income, infant_survival_rate, label = group, color = group)) +
687
- scale_x_continuous(trans = "log2", limits = c(0.25, 150)) +
687
+ scale_x_continuous(trans = "log2", limit = c(0.25, 150)) +
688
688
scale_y_continuous(trans = "logit", limit = c(0.875, .9981),
689
689
breaks = c(.85,.90,.95,.99,.995,.998)) +
690
690
geom_label(size = 3, show.legend = FALSE)
@@ -715,7 +715,7 @@ highlight <- c("Sierra Leone", "Mauritius", "Sudan", "Botswana", "Tunisia",
715
715
"United States","Sweden", "Angola", "Serbia")
716
716
717
717
gapminder %>% filter(year %in% present_year & !is.na(gdp) & !is.na(infant_mortality) & !is.na(group) ) %>%
718
- ggplot(aes(dollars_per_day, 1 - infant_mortality/1000, col = group, label = country)) +
718
+ ggplot(aes(dollars_per_day, 1 - infant_mortality/1000, color = group, label = country)) +
719
719
scale_x_continuous(trans = "log2", limits=c(0.25, 150)) +
720
720
scale_y_continuous(trans = "logit",limit=c(0.875, .9981),
721
721
breaks=c(.85,.90,.95,.99,.995,.998)) +
0 commit comments