-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFigureS2.R
160 lines (136 loc) · 7.78 KB
/
FigureS2.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
library(readxl)
library(ggplot2)
library(lubridate)
library(tidyverse)
library(dplyr)
library(ggrepel)
library(ggpubr)
db <- read_xlsx('db.xlsx')
options(scipen=999)
africa <- subset(db, db$Continent == 'Africa')
africa_db <- ggplot()+
theme_classic()+
geom_point(data = db, aes(x=GDP, y=DALY,size = Population), alpha = 0.6, colour = 'grey90')+
geom_point(data = africa, aes(x=GDP, y=DALY,size = Population,colour = Continent))+
theme(axis.text.x = element_text(color="black", size=10))+
theme(axis.title.y = element_text(color="black", size=10))+
theme(axis.text.y = element_text(color="black", size=10))+
scale_color_manual(values=c('#1b4332'), name='')+
xlab('GDP per capita ($)')+
ylab('Share of disease burden from communicable disease (DALY)')+
ylim(0, 80)+
scale_size(range=c(0,8), limits = c(10000,1450000000), breaks=c(10000, 50000000, 75000000,1000000000, 1450000000), labels=c('10,000', '50 million', '75 million','1 billion', '1.45 billion'))+
geom_text_repel(data=africa, mapping = aes(x=GDP, y=DALY,label = Entity), size =2.0)+
coord_cartesian(clip = "off") +
theme(legend.title = element_blank())+
theme(legend.position = 'right')+
theme(legend.text = element_text(color="black", size=10))+
guides(colour = guide_legend(override.aes = list(size = 3, alpha = 1)))+
scale_x_continuous(trans = 'log10', breaks = c(1000,2000, 5000, 10000, 20000, 50000, 100000))
africa_db
asia_db <- subset(db, db$Continent == 'Asia')
asia_db_plot <- ggplot()+
theme_classic()+
geom_point(data = db, aes(x=GDP, y=DALY,size = Population), alpha = 0.6, colour = 'grey90')+
geom_point(data = asia_db, aes(x=GDP, y=DALY,size = Population,colour = Continent))+
theme(axis.text.x = element_text(color="black", size=10))+
theme(axis.title.y = element_text(color="black", size=10))+
theme(axis.text.y = element_text(color="black", size=10))+
scale_color_manual(values=c('#1bb28c'), name='')+
xlab('GDP per capita ($)')+
ylab('Share of disease burden from communicable disease (DALY)')+
ylim(0, 80)+
scale_size(range=c(0,8), limits = c(10000,1450000000), breaks=c(10000, 50000000, 75000000,1000000000, 1450000000), labels=c('10,000', '50 million', '75 million','1 billion', '1.45 billion'))+
geom_text_repel(data=asia_db, mapping = aes(x=GDP, y=DALY,label = Entity), size =2.0)+
coord_cartesian(clip = "off") +
theme(legend.title = element_blank())+
theme(legend.position = 'right')+
theme(legend.text = element_text(color="black", size=10))+
guides(colour = guide_legend(override.aes = list(size = 3, alpha = 1)))+
scale_x_continuous(trans = 'log10', breaks = c(1000,2000, 5000, 10000, 20000, 50000, 100000))
asia_db_plot
europe_db <- subset(db, db$Continent == 'Europe')
europe_plot <- ggplot()+
theme_classic()+
geom_point(data = db, aes(x=GDP, y=DALY,size = Population), alpha = 0.6, colour = 'grey90')+
geom_point(data = europe_db, aes(x=GDP, y=DALY,size = Population,colour = Continent))+
theme(axis.text.x = element_text(color="black", size=10))+
theme(axis.title.y = element_text(color="black", size=10))+
theme(axis.text.y = element_text(color="black", size=10))+
scale_color_manual(values=c('#bb8557'), name='')+
xlab('GDP per capita ($)')+
ylab('Share of disease burden from communicable disease (DALY)')+
ylim(0, 80)+
scale_size(range=c(0,8), limits = c(10000,1450000000), breaks=c(10000, 50000000, 75000000,1000000000, 1450000000), labels=c('10,000', '50 million', '75 million','1 billion', '1.45 billion'))+
geom_text_repel(data=europe_db, mapping = aes(x=GDP, y=DALY,label = Entity), size =2.0, max.overlaps = 40)+
coord_cartesian(clip = "off") +
theme(legend.title = element_blank())+
theme(legend.position = 'right')+
theme(legend.text = element_text(color="black", size=10))+
guides(colour = guide_legend(override.aes = list(size = 0, alpha = 1)))+
scale_x_continuous(trans = 'log10', breaks = c(1000,2000, 5000, 10000, 20000, 50000, 100000))
europe_plot
NA_db <- subset(db, db$Continent == 'North America')
NA_plot <- ggplot()+
theme_classic()+
geom_point(data = db, aes(x=GDP, y=DALY,size = Population), alpha = 0.6, colour = 'grey90')+
geom_point(data = NA_db, aes(x=GDP, y=DALY,size = Population,colour = Continent))+
theme(axis.text.x = element_text(color="black", size=10))+
theme(axis.title.y = element_text(color="black", size=10))+
theme(axis.text.y = element_text(color="black", size=10))+
scale_color_manual(values=c('#fed45b'), name='')+
xlab('GDP per capita ($)')+
ylab('Share of disease burden from communicable disease (DALY)')+
ylim(0, 80)+
scale_size(range=c(0,8), limits = c(10000,1450000000), breaks=c(10000, 50000000, 75000000,1000000000, 1450000000), labels=c('10,000', '50 million', '75 million','1 billion', '1.45 billion'))+
geom_text_repel(data=NA_db, mapping = aes(x=GDP, y=DALY,label = Entity), size =2.0, max.overlaps = 40)+
coord_cartesian(clip = "off") +
theme(legend.title = element_blank())+
theme(legend.position = 'right')+
theme(legend.text = element_text(color="black", size=10))+
guides(colour = guide_legend(override.aes = list(size = 3, alpha = 1)))+
scale_x_continuous(trans = 'log10', breaks = c(1000,2000, 5000, 10000, 20000, 50000, 100000))
NA_plot
Oceania_db <- subset(db, db$Continent == 'Oceania')
Oceania_plot <- ggplot()+
theme_classic()+
geom_point(data = db, aes(x=GDP, y=DALY,size = Population), alpha = 0.6, colour = 'grey90')+
geom_point(data = Oceania_db, aes(x=GDP, y=DALY,size = Population,colour = Continent))+
theme(axis.text.x = element_text(color="black", size=10))+
theme(axis.title.y = element_text(color="black", size=10))+
theme(axis.text.y = element_text(color="black", size=10))+
scale_color_manual(values=c('#007ea7'), name='')+
xlab('GDP per capita ($)')+
ylab('Share of disease burden from communicable disease (DALY)')+
ylim(0, 80)+
scale_size(range=c(0,8), limits = c(10000,1450000000), breaks=c(10000, 50000000, 75000000,1000000000, 1450000000), labels=c('10,000', '50 million', '75 million','1 billion', '1.45 billion'))+
geom_text_repel(data=Oceania_db, mapping = aes(x=GDP, y=DALY,label = Entity), size =2.5, max.overlaps = 40)+
coord_cartesian(clip = "off") +
theme(legend.title = element_blank())+
theme(legend.position = 'right')+
theme(legend.text = element_text(color="black", size=10))+
guides(colour = guide_legend(override.aes = list(size = 3, alpha = 1)))+
scale_x_continuous(trans = 'log10', breaks = c(1000,2000, 5000, 10000, 20000, 50000, 100000))
Oceania_plot
SA_db <- subset(db, db$Continent == 'South America')
SA_plot <- ggplot()+
theme_classic()+
geom_point(data = db, aes(x=GDP, y=DALY,size = Population), alpha = 0.6, colour = 'grey90')+
geom_point(data = SA_db, aes(x=GDP, y=DALY,size = Population,colour = Continent))+
theme(axis.text.x = element_text(color="black", size=10))+
theme(axis.title.y = element_text(color="black", size=10))+
theme(axis.text.y = element_text(color="black", size=10))+
scale_color_manual(values=c('#e86a58'), name='')+
xlab('GDP per capita ($)')+
ylab('Share of disease burden from communicable disease (DALY)')+
ylim(0, 80)+
scale_size(range=c(0,8), limits = c(10000,1450000000), breaks=c(10000, 50000000, 75000000,1000000000, 1450000000), labels=c('10,000', '50 million', '75 million','1 billion', '1.45 billion'))+
geom_text_repel(data=SA_db, mapping = aes(x=GDP, y=DALY,label = Entity), size =2.5, max.overlaps = 40)+
coord_cartesian(clip = "off") +
theme(legend.title = element_blank())+
theme(legend.position = 'right')+
theme(legend.text = element_text(color="black", size=10))+
guides(colour = guide_legend(override.aes = list(size = 3, alpha = 1)))+
scale_x_continuous(trans = 'log10', breaks = c(1000,2000, 5000, 10000, 20000, 50000, 100000))
SA_plot
ggarrange(africa_db, asia_db_plot,SA_plot, Oceania_plot, NA_plot, europe_plot , nrow =2, ncol = 3, common.legend = TRUE)