setwd("~/Google Drive/Agrosavia/Colaboraciones/Fabricio/data")
datos3 <- read.table("low.csv", header=T, sep=",")
datos4 <- read.table("high.csv", header=T, sep=",")

##Correlations for low light
library("ggpubr")
## Loading required package: ggplot2
ggscatter(datos3, x = "Ardpi", y = "yield", 
          conf.int = F, 
          cor.coef = TRUE, cor.method = "pearson",
          xlab = "Plasticity in A", ylab = "Yield")

ggscatter(datos3, x = "Erdpi", y = "yield", 
          conf.int = F, 
          cor.coef = TRUE, cor.method = "pearson",
          xlab = "Plasticity in E", ylab = "Yield")

ggscatter(datos3, x = "WUErdpi", y = "yield", 
          conf.int = F, 
          cor.coef = TRUE, cor.method = "pearson",
          xlab = "Plasticity in WUE", ylab = "Yield")

ggscatter(datos3, x = "gswrdpi", y = "yield", 
          conf.int = F, 
          cor.coef = TRUE, cor.method = "pearson",
          xlab = "Plasticity in GSW", ylab = "Yield")

ggscatter(datos3, x = "cicardpi", y = "yield", 
          conf.int = F, 
          cor.coef = TRUE, cor.method = "pearson",
          xlab = "Plasticity in Ci/Ca", ylab = "Yield")

## Correlations for high light


ggscatter(datos4, x = "Ardpi", y = "yield", 
          conf.int = F, 
          cor.coef = TRUE, cor.method = "pearson",
          xlab = "Plasticity in A", ylab = "Yield")

ggscatter(datos4, x = "Erdpi", y = "yield", 
          conf.int = F, 
          cor.coef = TRUE, cor.method = "pearson",
          xlab = "Plasticity in E", ylab = "Yield")

ggscatter(datos4, x = "WUErdpi", y = "yield", 
          add = "reg.line", conf.int = F, 
          cor.coef = TRUE, cor.method = "pearson",
          xlab = "Plasticity in WUE", ylab = "Yield")
## `geom_smooth()` using formula 'y ~ x'

ggscatter(datos4, x = "gswrdpi", y = "yield", 
          conf.int = F, 
          cor.coef = TRUE, cor.method = "pearson",
          xlab = "Plasticity in GSW", ylab = "Yield")

ggscatter(datos4, x = "cicardpi", y = "yield", 
          add = "reg.line", conf.int = F, 
          cor.coef = TRUE, cor.method = "pearson",
          xlab = "Plasticity in Ci/Ca", ylab = "Yield")
## `geom_smooth()` using formula 'y ~ x'