IC <- subset(IC,IC$RME>0)
IC[order(IC$RME), ] -> IC
IC[order(IC$GRUPO),] -> IC
1:length(IC$RME) -> IC$ORDEN
etq <- c( 'Baja' , 'Moderadamente baja','Diferencia no significativa',
'Moderadamente alta','Alta')
IC$GRUPO <- factor(IC$GRUPO,labels = etq )
IC$GRUPO <- factor(IC$GRUPO,levels = rev(etq) )
mycol <- c('#d7191c','#fdae61','#ffffbf','#a6d96a','#1a9641')
tips <- c(0.25,0.5,1,2,4)
require(ggplot2)
ggplot(IC, aes(x=ORDEN, y=RME, colour=GRUPO)) +
geom_errorbar(aes(ymin=LIC, ymax=UIC), width=0) +
geom_point(size=.5,colour= 'gray') +
theme_bw() +
scale_colour_manual(values = mycol) +
labs(list(x = "5381 secciones censales de Andalucía",
y = "RME con Intervalos de Confianza al 95%")) +
theme(legend.position = c(0.2, 0.8)) +
geom_hline(yintercept=1,color='blue') +
scale_y_log10(breaks=tips,labels=tips) +
theme(legend.background = element_rect(fill="gray90", size=.5 ))