library(ggplot2)
library(tidyr)
#faili sisselugemine ja andmete formaadi korrigeerimine
J335=na.omit(read.csv("PT3-T3.3-J3.3.5.csv",header=TRUE, encoding ="UTF-8")[1:6,])
names(J335)[2:3]=c("I like distance learning","I like going to school")
J335=pivot_longer(J335,2:3)
#joonis
ggplot(J335)+
geom_col(aes(x=X,y=value,fill=name),pos=position_dodge(0.8),width=0.7)+
geom_label(aes(x=X,y=value,group=name,label=value),pos=position_dodge(0.8))+
theme_minimal()+
theme(legend.position = "bottom")+
scale_fill_manual(values=c("#E9A419","#2E938B","#365418"))+
scale_y_continuous(limits=c(0,80),breaks=seq(0,80,10))+
theme(legend.title = element_blank())+
ylab("")+
xlab("")
