-
Notifications
You must be signed in to change notification settings - Fork 1
/
61_migration_cloud_service.R
31 lines (27 loc) · 1.49 KB
/
61_migration_cloud_service.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
# Question 6.1 How much are you interested in migrating your processing tasks to a cloud service in the future?
# Add general groups to data frame
df_61_freq_ord$group <- c('Interest', 'Interest', 'Neutral', 'No interest', 'No interest')
# Calculate summarized percentage for interest / no interest classes
interest_sum <- sum(df_61_freq_ord[c(1,2),3])
no_interest_sum <- sum(df_61_freq_ord[c(4,5),3])
# Make vector with percentage sums to add as labels
percSums <- c(interest_sum,interest_sum, df_61_freq_ord[3,3], no_interest_sum, no_interest_sum)
# Bar plot with combining Interest and no interest classes
likert_perc <- ggplot(data=df_61_freq_ord, aes(x=group, y=perc, fill=Interest)) +
geom_bar(stat='identity', position=position_dodge(width=0.55),width=0.5,aes(y=perc, fill=Interest))+
scale_fill_manual(values=rev(brewer.pal(n=5,'BrBG'))) +
labs(x="", y="rel. Frequency\n") +
theme_light()+
ylim(-1,45)+
geom_text(aes(y=0,label=round(perc,1)), position=position_dodge(width=0.55), vjust=-0.4, color='black', size=6) +
geom_label(y= 42, aes(x=group,label=round(percSums,1)), size=6, show.legend=FALSE) +
guides(fill=guide_legend())+
theme(legend.position='bottom',
legend.title=element_blank(),
plot.title=element_text(size=16),
axis.text=element_text(size=16),
legend.text = element_text(size=16),
strip.text.x=element_text(size=16),
axis.title = element_text(size=16),
aspect.ratio = 1/4) +
scale_x_discrete(labels = wrap_format(20))