-
Notifications
You must be signed in to change notification settings - Fork 1
/
1_personal_information.R
30 lines (26 loc) · 1.04 KB
/
1_personal_information.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
# Grouped - Country of residence
barplot_1 <- ggplot(df_11_freq_ord, aes(fill=cor,y=freq, x=cor)) +
geom_bar(stat="identity",width=0.7) +
labs(x="", y="n") +
coord_flip() +
scale_x_discrete(labels=wrap_format(30))+
ylim(0,55) +
theme_light() +
theme(legend.title=element_blank(), legend.position = "none", aspect.ratio=2/1,
axis.text=element_text(size=12),
legend.text = element_text(size=12),
strip.text.x=element_text(size=12),
axis.title = element_text(size=14))
# Grouped - Age groups
barplot_14 <- ggplot(df_14_freq, aes(fill=age.group,y=freq, x=age.group)) +
geom_bar(stat="identity",width=0.7) +
scale_fill_brewer(palette="Spectral",direction=1) +
labs(x="", y="%") +
scale_x_discrete(labels=wrap_format(30))+
ylim(0,105) +
theme_light() +
theme(legend.title=element_blank(), legend.position = "none", aspect.ratio=1/2,
axis.text=element_text(size=12),
legend.text = element_text(size=12),
strip.text.x=element_text(size=12),
axis.title = element_text(size=14))