library(ggplot2)
library(plotly)
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
#faili sisselugemine ja andmete formaadi korrigeerimine
J136=read.csv2("PT1-T1.3-J1.3.6.csv",header=TRUE, encoding ="UTF-8")
J136$col="#6666cc"
J136$col[J136$Riik=="EESTI"]="#FF3600"
col=J136$col  

#joonis
ggplot(J136,aes(x=SKP,y=Palk))+
  geom_point(cex=4,col=col)+
  geom_smooth(method="lm", linewidth=1,col="#668080",se=FALSE)+
  theme_minimal()+
  geom_text(aes(x=SKP+3,y=Palk+1.5,label=Riik),col="#668080")+
  theme(text = element_text(color="#668080"),axis.text=element_text(color="#668080"))+
  theme(legend.position = "none")+
  scale_x_continuous(breaks=seq(0,200,20))+
  ylab("%")+
  xlab("SKP ostujĂľu pariteet")
## `geom_smooth()` using formula = 'y ~ x'