library(ggplot2)
library(tidyr)
#faili sisselugemine ja andmete formaadi korrigeerimine
J145=read.csv("PT1-T1.4-J1.4.5.csv",header=TRUE, encoding ="UTF-8")
J145=J145[,1:4]
names(J145)[2:4]=c("OR","lower","upper")
J145$X=as.factor(J145$X)
J145$X=factor(J145$X,rev(levels(J145$X)[order(c(6,9,8,1,4,7,2,3,5))]))
#joonis
ggplot(J145,aes(x=X,y=OR))+
geom_point(cex=3,col="#FF3600")+
geom_errorbar(aes(x=X,ymin=lower,ymax=upper),width=0.1,linewidth=0.7,col="#FF3600")+
theme_minimal()+
theme(text = element_text(color="#668080"),axis.text=element_text(color="#668080"))+
coord_flip()+
xlab("")+
ylab("Ĺ ansisuhe (OR)")+
scale_y_continuous(limits=c(1,7),breaks=c(1,2,3,4,5,6,7))
