#*******************************************Gr??ficas Boxplot*********************************************** #Cargamos datos library(ggplot2) setwd("C:/Users/Laboratorio/Desktop/complejidad_clase/??ndices de complejidad/??ndices humedad") #*************************************Boxplot de complejidad********************************** #*************************************UNIR ARCHIVOS DE EXCEL********************************** setwd("C:/Users/Laboratorio/Desktop/complejidad_clase/??ndices de complejidad/??ndices humedad") complej2014<-read.table("Complej2014Hum.csv", sep=",",header=T) complej2015<-read.table("Complej2015Hum.csv", sep=",",header=T) complej2016<-read.table("Complej2016Hum.csv", sep=",",header=T) complej2017<-read.table("Complej2017Hum.csv", sep=",",header=T) complej2018<-read.table("Complej2018Hum.csv", sep=",",header=T) tiempos<-read.table("a??os_unir.csv", sep=",",header=T) complej<-rbind(complej2014,complej2015,complej2016,complej2017,complej2018) complej_tiempos<-cbind(complej,tiempos) complejidad<-complej_tiempos[,2:3] names(complejidad)=c("Complejidad","A??os") dfcomplejidad<-data.frame(complejidad) A??os<-as.factor(dfcomplejidad$A??os) getwd() jpeg(filename="Medida de Complejidad (Humedad).jpeg") f1<-ggplot(dfcomplejidad, aes(x=A??os, y=Complejidad, fill=as.factor(A??os))) + geom_boxplot(alpha=0.8) +theme_bw()+ theme(legend.position="none")+geom_jitter(shape=16,col=rgb(0,0,0,.2), position = position_jitter(0.21))+ ggtitle("Medida de Complejidad (Humedad)") + theme(plot.title = element_text(hjust = 0.5))+ theme(axis.text.x = element_text(size = 11,color="black"), axis.text.y = element_text(size = 11,color="black")) f1 dev.off() #------------------------------------------------------------------------------------------------------------------- #************************************Boxplot de autoorganizaci??n******************************* #**************************************UNIR ARCHIVOS DE EXCEL********************************** setwd("C:/Users/Laboratorio/Desktop/complejidad_clase/??ndices de complejidad/??ndices humedad") autoor2014<-read.table("Autoorg2014Hum.csv", sep=",",header=T) autoor2015<-read.table("Autoorg2015Hum.csv", sep=",",header=T) autoor2016<-read.table("Autoorg2016Hum.csv", sep=",",header=T) autoor2017<-read.table("Autoorg2017Hum.csv", sep=",",header=T) autoor2018<-read.table("Autoorg2018Hum.csv", sep=",",header=T) tiempos<-read.table("a??os_unir.csv", sep=",",header=T) autoorg<-rbind(autoor2014,autoor2015,autoor2016,autoor2017,autoor2018) autoorg_tiempos<-cbind(autoorg,tiempos) autoorganizacion<-autoorg_tiempos[,2:3] names(autoorganizacion)=c("Autoorganizaci??n","A??os") dfautoorganizacion<-data.frame(autoorganizacion) A??os<-as.factor(dfautoorganizacion$A??os) getwd() jpeg(filename="Medida de Autoorganizaci??n (Humedad).jpeg") f2<-ggplot(dfautoorganizacion, aes(x=A??os, y=Autoorganizaci??n,fill=as.factor(A??os))) + geom_boxplot(alpha=0.8) +theme_bw()+ theme(legend.position="none")+geom_jitter(shape=16,col=rgb(0,0,0,.2), position = position_jitter(0.21))+ ggtitle("Medida de Autoorganizaci??n (Humedad)") + theme(plot.title = element_text(hjust = 0.5))+ theme(axis.text.x = element_text(size = 11,color="black"), axis.text.y = element_text(size = 11,color="black")) f2 dev.off() #------------------------------------------------------------------------------------------------------------------- #***********************************Boxplot de Informaci??n de Fisher************************** #***************************************UNIR ARCHIVOS DE EXCEL******************************** setwd("C:/Users/Laboratorio/Desktop/complejidad_clase/??ndices de complejidad/??ndices humedad") fisher2014<-read.table("Fisher2014Hum.csv", sep=",",header=T) fisher2015<-read.table("Fisher2015Hum.csv", sep=",",header=T) fisher2016<-read.table("Fisher2016Hum.csv", sep=",",header=T) fisher2017<-read.table("Fisher2017Hum.csv", sep=",",header=T) fisher2018<-read.table("Fisher2018Hum.csv", sep=",",header=T) tiempos<-read.table("a??os_unir.csv", sep=",",header=T) fish<-rbind(fisher2014,fisher2015,fisher2016,fisher2017,fisher2018) fisher_tiempos<-cbind(fish,tiempos) fisher<-fisher_tiempos[,2:3] names(fisher)=c("Fisher","A??os") dffisher<-data.frame(fisher) A??os<-as.factor(dffisher$A??os) getwd() jpeg(filename="Informaci??n de Fisher (Humedad).jpeg") f3<-ggplot(dffisher, aes(x=A??os, y=Fisher,fill=as.factor(A??os))) + geom_boxplot(alpha=0.8) +theme_bw()+ theme(legend.position="none")+geom_jitter(shape=16,col=rgb(0,0,0,.2), position = position_jitter(0.21))+ ggtitle("Informaci??n de Fisher (Humedad)") + theme(plot.title = element_text(hjust = 0.5))+ theme(axis.text.x = element_text(size = 11,color="black"), axis.text.y = element_text(size = 11,color="black")) f3 dev.off() #--------------------------------------------------------------------------------------------------------------------- #******************************************Boxplot de Entrop??a******************************** #****************************************UNIR ARCHIVOS DE EXCEL******************************* setwd("C:/Users/Laboratorio/Desktop/complejidad_clase/??ndices de complejidad/??ndices humedad") entropia2014<-read.table("Pentropy2014Hum.csv", sep=",",header=T) entropia2015<-read.table("Pentropy2015Hum.csv", sep=",",header=T) entropia2016<-read.table("Pentropy2016Hum.csv", sep=",",header=T) entropia2017<-read.table("Pentropy2017Hum.csv", sep=",",header=T) entropia2018<-read.table("Pentropy2018Hum.csv", sep=",",header=T) tiempos<-read.table("a??os_unir.csv", sep=",",header=T) entropy<-rbind(entropia2014,entropia2015,entropia2016,entropia2017,entropia2018) entropia_tiempos<-cbind(entropy,tiempos) entropia<-entropia_tiempos[,2:3] names(entropia)=c("Entrop??a","A??os") dfentropia<-data.frame(entropia) A??os<-as.factor(dfentropia$A??os) getwd() jpeg(filename="Medida de entrop??a (Humedad).jpeg") f4<-ggplot(dfentropia, aes(x=A??os, y=Entrop??a,fill=as.factor(A??os))) + geom_boxplot(alpha=0.8) +theme_bw()+ theme(legend.position="none")+geom_jitter(shape=16,col=rgb(0,0,0,.2), position = position_jitter(0.21))+ ggtitle("Medida de Entrop??a (Humedad)") + theme(plot.title = element_text(hjust = 0.5))+ theme(axis.text.x = element_text(size = 11,color="black"), axis.text.y = element_text(size = 11,color="black")) f4 dev.off() #------------------------------------------------------------------------------------------------------------------ #*********************************************Gr??ficas de viol??n**************************************** #*******************************************Viol??n de complejidad*************************************** getwd() jpeg(filename="Medida de Complejidad_Viol??n (Humedad).jpeg") f5<-ggplot(dfcomplejidad, aes(x=A??os, y=Complejidad, fill=as.factor(A??os))) + geom_violin(adjust = .5,alpha=0.8) +theme_bw()+geom_boxplot(width=0.1)+ theme(legend.position="none")+ geom_jitter(shape=16,col=rgb(0,0,0,.2),position = position_jitter(0.21))+ ggtitle("Medida de Complejidad (Humedad)")+ theme(plot.title = element_text(hjust = 0.5))+ theme(axis.text.x = element_text(size = 11,color="black"), axis.text.y = element_text(size = 11,color="black")) f5 dev.off() #-------------------------------------------------------------------------------------------------------------------- #******************************************Viol??n de Autoorganizaci??n************************************* getwd() jpeg(filename="Medida de Autoorganizaci??n_Viol??n (Humedad).jpeg") f6<-ggplot(dfautoorganizacion, aes(x=A??os, y=Autoorganizaci??n, fill=as.factor(A??os))) + geom_violin(adjust = .5,alpha=0.8) +theme_bw()+geom_boxplot(width=0.1)+ theme(legend.position="none")+ geom_jitter(shape=16,col=rgb(0,0,0,.2),position = position_jitter(0.21))+ ggtitle("Medida de Autoorganizaci??n (Humedad)")+ theme(plot.title = element_text(hjust = 0.5))+ theme(axis.text.x = element_text(size = 11,color="black"), axis.text.y = element_text(size = 11,color="black")) f6 dev.off() #--------------------------------------------------------------------------------------------------------------------- #*********************************************Viol??n de Fisher********************************************* getwd() jpeg(filename="Informaci??n de Fisher_Viol??n (Humedad).jpeg") f7<-ggplot(dffisher, aes(x=A??os, y=Fisher, fill=as.factor(A??os))) + geom_violin(adjust = .5,alpha=0.8) +theme_bw()+geom_boxplot(width=0.1)+ theme(legend.position="none")+ geom_jitter(shape=16,col=rgb(0,0,0,.2),position = position_jitter(0.21))+ ggtitle("Informaci??n de Fisher (Humedad)")+ theme(plot.title = element_text(hjust = 0.5))+ theme(axis.text.x = element_text(size = 11,color="black"), axis.text.y = element_text(size = 11,color="black")) f7 dev.off() #---------------------------------------------------------------------------------------------------------------------- #*******************************************Viol??n de Entrop??a********************************************** getwd() jpeg(filename="Medida de Entrop??a_Viol??n (Humedad).jpeg") f8<-ggplot(dfentropia, aes(x=A??os, y=Entrop??a, fill=as.factor(A??os))) + geom_violin(adjust = .5,alpha=0.8) +theme_bw()+geom_boxplot(width=0.1)+ theme(legend.position="none")+ geom_jitter(shape=16,col=rgb(0,0,0,.2),position = position_jitter(0.21))+ ggtitle("Medida de Entrop??a (Humedad)")+ theme(plot.title = element_text(hjust = 0.5))+ theme(axis.text.x = element_text(size = 11,color="black"), axis.text.y = element_text(size = 11,color="black")) f8 dev.off() #----------------------------------------------------------------------------------------------------------------------