library(ggplot2)
library(tidyr)
#faili sisselugemine ja andmete formaadi korrigeerimine
J137=read.csv("PT1-T1.3-J1.3.7.csv",header=TRUE, encoding ="UTF-8")
## Warning in read.table(file = file, header = header, sep = sep, quote = quote, :
## incomplete final line found by readTableHeader on 'PT1-T1.3-J1.3.7.csv'
names(J137)[2:4]=c("1999","2008","2018")
J137=pivot_longer(J137,c("1999","2008","2018"))
names(J137)=c("Haridus","Aasta","Protsent")


#joonis
  ggplot(J137,aes(x=Aasta,y=Protsent,col=Haridus))+
  geom_point(cex=3)+
  geom_line(aes(col=Haridus,group=Haridus),linewidth=1.5)+
  scale_y_continuous(breaks=seq(0,100,10),limits=c(0,90))+
  scale_color_manual(values=c("#FF3600","#38bf7b","#6666cc","#1E272E"))+
  theme_minimal()+
  theme(text = element_text(color="#668080"),axis.text=element_text(color="#668080"))+
  theme(legend.position = "bottom")+
  ylab("%")