setwd("~/Library/CloudStorage/GoogleDrive-icarounam@gmail.com/Mi unidad/Agrosavia/Colaboraciones/Fabricio/Recharged_20C/data")
library(Plasticity)
library(agricolae)
library(Rmisc)
## Loading required package: lattice
## Loading required package: plyr
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:plyr':
## 
##     arrange, count, desc, failwith, id, mutate, rename, summarise,
##     summarize
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(ggplot2)
library(psych)
## 
## Attaching package: 'psych'
## The following objects are masked from 'package:ggplot2':
## 
##     %+%, alpha
library(FSA)
## ## FSA v0.9.1. See citation('FSA') if used in publication.
## ## Run fishR() for related website and fishR('IFAR') for related book.
## 
## Attaching package: 'FSA'
## The following object is masked from 'package:psych':
## 
##     headtail
## The following object is masked from 'package:plyr':
## 
##     mapvalues
library(forcats)
library(Hmisc)
## Loading required package: survival
## Loading required package: Formula
## 
## Attaching package: 'Hmisc'
## The following object is masked from 'package:psych':
## 
##     describe
## The following objects are masked from 'package:dplyr':
## 
##     src, summarize
## The following objects are masked from 'package:plyr':
## 
##     is.discrete, summarize
## The following objects are masked from 'package:base':
## 
##     format.pval, units
library("PerformanceAnalytics")
## Loading required package: xts
## Loading required package: zoo
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
## 
## Attaching package: 'xts'
## The following objects are masked from 'package:dplyr':
## 
##     first, last
## 
## Attaching package: 'PerformanceAnalytics'
## The following objects are masked from 'package:agricolae':
## 
##     kurtosis, skewness
## The following object is masked from 'package:graphics':
## 
##     legend
library(onewaytests)
## Registered S3 methods overwritten by 'car':
##   method       from
##   hist.boot    FSA 
##   confint.boot FSA
## 
## Attaching package: 'onewaytests'
## The following object is masked from 'package:Hmisc':
## 
##     describe
## The following object is masked from 'package:psych':
## 
##     describe
library(emmeans)
library(ggthemes)
library(multcompView)
library(RColorBrewer)
clone <- read.table("res_fin.csv", header=T, sep=",")
clone$Repetición<-as.factor(clone$Repetición)
clone$Clon<-as.factor(clone$Clon)
clone$env<-as.factor(clone$env)
## Generando bases de datos para cada ambiente
clone.100 <- filter(clone, clone$env == "100")
clone.300 <- filter(clone, clone$env == "300")
clone.500 <- filter(clone, clone$env == "500")
clone.800 <- filter(clone, clone$env == "800")
clone.900 <- filter(clone, clone$env == "900")
clone.1200 <- filter(clone, clone$env == "1200")
clone.1500 <- filter(clone, clone$env == "1500")
clone.2000 <- filter(clone, clone$env == "2000")

##Quitando las intensidades de luz no utilizadas
clone.100.fin <- droplevels(clone.100)
clone.300.fin <- droplevels(clone.300)
clone.500.fin <- droplevels(clone.500)
clone.800.fin <- droplevels(clone.800)
clone.900.fin <- droplevels(clone.900)
clone.1200.fin <- droplevels(clone.1200)
clone.1500.fin <- droplevels(clone.1500)
clone.2000.fin <- droplevels(clone.2000)
##Convirtiendo a factor los genotipos y ambientes
#genotipos
clone.100.fin$Clon<-as.factor(clone.100.fin$Clon)
clone.300.fin$Clon<-as.factor(clone.300.fin$Clon)
clone.500.fin$Clon<-as.factor(clone.500.fin$Clon)
clone.800.fin$Clon<-as.factor(clone.800.fin$Clon)
clone.900.fin$Clon<-as.factor(clone.900.fin$Clon)
clone.1200.fin$Clon<-as.factor(clone.1200.fin$Clon)
clone.1500.fin$Clon<-as.factor(clone.1500.fin$Clon)
clone.2000.fin$Clon<-as.factor(clone.2000.fin$Clon)
#ambientes
clone.100.fin$env<-as.factor(clone.100.fin$env)
clone.300.fin$env<-as.factor(clone.300.fin$env)
clone.500.fin$env<-as.factor(clone.500.fin$env)
clone.800.fin$env<-as.factor(clone.800.fin$env)
clone.900.fin$env<-as.factor(clone.900.fin$env)
clone.1200.fin$env<-as.factor(clone.1200.fin$env)
clone.1500.fin$env<-as.factor(clone.1500.fin$env)
clone.2000.fin$env<-as.factor(clone.2000.fin$env)

## A
A.100<-aov(A~Clon, data = clone.100.fin)
A.300<-aov(A~Clon, data = clone.300.fin)
A.500<-aov(A~Clon, data = clone.500.fin)
A.800<-aov(A~Clon, data = clone.800.fin)
A.900<-aov(A~Clon, data = clone.900.fin)
A.1200<-aov(A~Clon, data = clone.1200.fin)
A.1500<-aov(A~Clon, data = clone.1500.fin)
A.2000<-aov(A~Clon, data = clone.2000.fin)
# Anova A 100
anova(A.100)
## Analysis of Variance Table
## 
## Response: A
##           Df Sum Sq Mean Sq F value    Pr(>F)    
## Clon      19 19.069 1.00364  3.7264 5.039e-05 ***
## Residuals 60 16.160 0.26933                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(A.300)
## Analysis of Variance Table
## 
## Response: A
##           Df Sum Sq Mean Sq F value    Pr(>F)    
## Clon      19 92.599  4.8736  4.5032 3.922e-06 ***
## Residuals 60 64.935  1.0823                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(A.500)
## Analysis of Variance Table
## 
## Response: A
##           Df  Sum Sq Mean Sq F value    Pr(>F)    
## Clon      19 115.148  6.0604  3.6947 5.612e-05 ***
## Residuals 60  98.419  1.6403                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(A.800)
## Analysis of Variance Table
## 
## Response: A
##           Df Sum Sq Mean Sq F value   Pr(>F)   
## Clon      19 103.20  5.4314  2.4202 0.004945 **
## Residuals 60 134.65  2.2442                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(A.900)
## Analysis of Variance Table
## 
## Response: A
##           Df  Sum Sq Mean Sq F value Pr(>F)
## Clon      19  74.638  3.9283  1.3748 0.1747
## Residuals 60 171.449  2.8575
anova(A.1200)
## Analysis of Variance Table
## 
## Response: A
##           Df Sum Sq Mean Sq F value Pr(>F)
## Clon      19  61.12  3.2168  0.8795 0.6079
## Residuals 60 219.45  3.6575
anova(A.1500)
## Analysis of Variance Table
## 
## Response: A
##           Df  Sum Sq Mean Sq F value Pr(>F)
## Clon      19  79.918  4.2062  1.0063 0.4675
## Residuals 60 250.781  4.1797
anova(A.2000)
## Analysis of Variance Table
## 
## Response: A
##           Df Sum Sq Mean Sq F value Pr(>F)
## Clon      19 100.46  5.2876  1.2185 0.2741
## Residuals 60 260.37  4.3396
## E
E.100<-aov(E~Clon, data = clone.100.fin)
E.300<-aov(E~Clon, data = clone.300.fin)
E.500<-aov(E~Clon, data = clone.500.fin)
E.800<-aov(E~Clon, data = clone.800.fin)
E.900<-aov(E~Clon, data = clone.900.fin)
E.1200<-aov(E~Clon, data = clone.1200.fin)
E.1500<-aov(E~Clon, data = clone.1500.fin)
E.2000<-aov(E~Clon, data = clone.2000.fin)
# Anova E 100
anova(E.100)
## Analysis of Variance Table
## 
## Response: E
##           Df Sum Sq Mean Sq F value    Pr(>F)    
## Clon      19 17.585 0.92552  2.9766 0.0006789 ***
## Residuals 60 18.656 0.31093                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(E.300)
## Analysis of Variance Table
## 
## Response: E
##           Df Sum Sq Mean Sq F value    Pr(>F)    
## Clon      19 18.242 0.96009  3.1226 0.0004056 ***
## Residuals 60 18.448 0.30747                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(E.500)
## Analysis of Variance Table
## 
## Response: E
##           Df Sum Sq Mean Sq F value   Pr(>F)   
## Clon      19 18.151 0.95529  2.7469 0.001536 **
## Residuals 60 20.866 0.34777                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(E.800)
## Analysis of Variance Table
## 
## Response: E
##           Df Sum Sq Mean Sq F value  Pr(>F)  
## Clon      19 16.536 0.87029  1.9334 0.02778 *
## Residuals 60 27.008 0.45014                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(E.900)
## Analysis of Variance Table
## 
## Response: E
##           Df Sum Sq Mean Sq F value Pr(>F)
## Clon      19 14.748 0.77621  1.3125   0.21
## Residuals 60 35.484 0.59140
anova(E.1200)
## Analysis of Variance Table
## 
## Response: E
##           Df Sum Sq Mean Sq F value Pr(>F)
## Clon      19 13.882 0.73063  0.9264 0.5548
## Residuals 60 47.320 0.78866
anova(E.1500)
## Analysis of Variance Table
## 
## Response: E
##           Df Sum Sq Mean Sq F value Pr(>F)
## Clon      19 22.495  1.1839  1.1316 0.3454
## Residuals 60 62.778  1.0463
anova(E.2000)
## Analysis of Variance Table
## 
## Response: E
##           Df Sum Sq Mean Sq F value Pr(>F)
## Clon      19 37.777  1.9883  1.4262 0.1494
## Residuals 60 83.648  1.3941
## WUE
WUE.100<-aov(WUE~Clon, data = clone.100.fin)
WUE.300<-aov(WUE~Clon, data = clone.300.fin)
WUE.500<-aov(WUE~Clon, data = clone.500.fin)
WUE.800<-aov(WUE~Clon, data = clone.800.fin)
WUE.900<-aov(WUE~Clon, data = clone.900.fin)
WUE.1200<-aov(WUE~Clon, data = clone.1200.fin)
WUE.1500<-aov(WUE~Clon, data = clone.1500.fin)
WUE.2000<-aov(WUE~Clon, data = clone.2000.fin)
# Anova WUE 100
anova(WUE.100)
## Analysis of Variance Table
## 
## Response: WUE
##           Df  Sum Sq Mean Sq F value  Pr(>F)  
## Clon      19  8.6667 0.45614  1.6975 0.06225 .
## Residuals 60 16.1226 0.26871                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(WUE.300)
## Analysis of Variance Table
## 
## Response: WUE
##           Df Sum Sq Mean Sq F value Pr(>F)
## Clon      19 12.900 0.67896  1.2814 0.2298
## Residuals 60 31.792 0.52987
anova(WUE.500)
## Analysis of Variance Table
## 
## Response: WUE
##           Df Sum Sq Mean Sq F value Pr(>F)
## Clon      19 12.889 0.67835  1.2358 0.2613
## Residuals 60 32.935 0.54891
anova(WUE.800)
## Analysis of Variance Table
## 
## Response: WUE
##           Df Sum Sq Mean Sq F value Pr(>F)
## Clon      19 11.101 0.58427  1.1782 0.3057
## Residuals 60 29.753 0.49588
anova(WUE.900)
## Analysis of Variance Table
## 
## Response: WUE
##           Df Sum Sq Mean Sq F value Pr(>F)
## Clon      19 11.017 0.57983  1.1624 0.3188
## Residuals 60 29.930 0.49883
anova(WUE.1200)
## Analysis of Variance Table
## 
## Response: WUE
##           Df  Sum Sq Mean Sq F value Pr(>F)
## Clon      19  8.2202 0.43264  1.1442 0.3344
## Residuals 60 22.6876 0.37813
anova(WUE.1500)
## Analysis of Variance Table
## 
## Response: WUE
##           Df  Sum Sq Mean Sq F value Pr(>F)
## Clon      19  6.3643 0.33496  1.1784 0.3056
## Residuals 60 17.0554 0.28426
anova(WUE.2000)
## Analysis of Variance Table
## 
## Response: WUE
##           Df  Sum Sq Mean Sq F value Pr(>F)
## Clon      19  5.2028 0.27383  1.4198 0.1523
## Residuals 60 11.5717 0.19286
## gsw
gsw.100<-aov(gsw~Clon, data = clone.100.fin)
gsw.300<-aov(gsw~Clon, data = clone.300.fin)
gsw.500<-aov(gsw~Clon, data = clone.500.fin)
gsw.800<-aov(gsw~Clon, data = clone.800.fin)
gsw.900<-aov(gsw~Clon, data = clone.900.fin)
gsw.1200<-aov(gsw~Clon, data = clone.1200.fin)
gsw.1500<-aov(gsw~Clon, data = clone.1500.fin)
gsw.2000<-aov(gsw~Clon, data = clone.2000.fin)
# Anova gsw 100
anova(gsw.100)
## Analysis of Variance Table
## 
## Response: gsw
##           Df   Sum Sq    Mean Sq F value    Pr(>F)    
## Clon      19 0.028254 0.00148705  4.1244 1.336e-05 ***
## Residuals 60 0.021633 0.00036055                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(gsw.300)
## Analysis of Variance Table
## 
## Response: gsw
##           Df   Sum Sq    Mean Sq F value    Pr(>F)    
## Clon      19 0.029535 0.00155445  4.3783 5.851e-06 ***
## Residuals 60 0.021302 0.00035503                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(gsw.500)
## Analysis of Variance Table
## 
## Response: gsw
##           Df   Sum Sq    Mean Sq F value    Pr(>F)    
## Clon      19 0.029313 0.00154277  3.4495 0.0001298 ***
## Residuals 60 0.026835 0.00044724                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(gsw.800)
## Analysis of Variance Table
## 
## Response: gsw
##           Df   Sum Sq    Mean Sq F value   Pr(>F)   
## Clon      19 0.026563 0.00139807  2.3211 0.007048 **
## Residuals 60 0.036140 0.00060233                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(gsw.900)
## Analysis of Variance Table
## 
## Response: gsw
##           Df   Sum Sq    Mean Sq F value Pr(>F)
## Clon      19 0.025148 0.00132357  1.4879 0.1232
## Residuals 60 0.053372 0.00088953
anova(gsw.1200)
## Analysis of Variance Table
## 
## Response: gsw
##           Df   Sum Sq   Mean Sq F value Pr(>F)
## Clon      19 0.029075 0.0015303  1.1085 0.3663
## Residuals 60 0.082830 0.0013805
anova(gsw.1500)
## Analysis of Variance Table
## 
## Response: gsw
##           Df   Sum Sq   Mean Sq F value Pr(>F)
## Clon      19 0.050199 0.0026421  1.4386 0.1438
## Residuals 60 0.110195 0.0018366
anova(gsw.2000)
## Analysis of Variance Table
## 
## Response: gsw
##           Df   Sum Sq   Mean Sq F value  Pr(>F)  
## Clon      19 0.090158 0.0047452  2.1218 0.01433 *
## Residuals 60 0.134186 0.0022364                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## cica
cica.100<-aov(cica~Clon, data = clone.100.fin)
cica.300<-aov(cica~Clon, data = clone.300.fin)
cica.500<-aov(cica~Clon, data = clone.500.fin)
cica.800<-aov(cica~Clon, data = clone.800.fin)
cica.900<-aov(cica~Clon, data = clone.900.fin)
cica.1200<-aov(cica~Clon, data = clone.1200.fin)
cica.1500<-aov(cica~Clon, data = clone.1500.fin)
cica.2000<-aov(cica~Clon, data = clone.2000.fin)
# Anova cica 100
anova(cica.100)
## Analysis of Variance Table
## 
## Response: cica
##           Df  Sum Sq   Mean Sq F value    Pr(>F)    
## Clon      19 0.19220 0.0101160  3.2955 0.0002215 ***
## Residuals 60 0.18418 0.0030697                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(cica.300)
## Analysis of Variance Table
## 
## Response: cica
##           Df  Sum Sq   Mean Sq F value    Pr(>F)    
## Clon      19 0.23260 0.0122420     2.9 0.0008905 ***
## Residuals 60 0.25328 0.0042213                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(cica.500)
## Analysis of Variance Table
## 
## Response: cica
##           Df  Sum Sq  Mean Sq F value   Pr(>F)   
## Clon      19 0.22562 0.011875  2.5298 0.003339 **
## Residuals 60 0.28164 0.004694                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(cica.800)
## Analysis of Variance Table
## 
## Response: cica
##           Df  Sum Sq  Mean Sq F value   Pr(>F)   
## Clon      19 0.22883 0.012044  2.2436 0.009294 **
## Residuals 60 0.32208 0.005368                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(cica.900)
## Analysis of Variance Table
## 
## Response: cica
##           Df  Sum Sq   Mean Sq F value  Pr(>F)  
## Clon      19 0.22306 0.0117402   2.122 0.01432 *
## Residuals 60 0.33195 0.0055325                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(cica.1200)
## Analysis of Variance Table
## 
## Response: cica
##           Df  Sum Sq   Mean Sq F value   Pr(>F)   
## Clon      19 0.24215 0.0127447  2.2525 0.009003 **
## Residuals 60 0.33948 0.0056579                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(cica.1500)
## Analysis of Variance Table
## 
## Response: cica
##           Df  Sum Sq  Mean Sq F value   Pr(>F)   
## Clon      19 0.25063 0.013191  2.6147 0.002465 **
## Residuals 60 0.30270 0.005045                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(cica.2000)
## Analysis of Variance Table
## 
## Response: cica
##           Df  Sum Sq  Mean Sq F value    Pr(>F)    
## Clon      19 0.21030 0.011069  2.9135 0.0008488 ***
## Residuals 60 0.22794 0.003799                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##Genotype means
# Genotype mean 100
A.100.mean <- clone.100.fin %>%
  select(Clon, A, E, WUE, gsw, cica) %>%
  group_by(Clon) %>%
  summarise(
    A_m = mean(A), 
    E_m = mean(E), 
    WUE_m = mean(WUE), 
    gsw_m = mean(gsw), 
    cica_m = mean(cica))
# Genotype pooled mean 100
A.100.mean.pond <- clone.100.fin %>%
  select(Clon, A, E, WUE, gsw, cica) %>%
    summarise(
    A_m = mean(A), 
    E_m = mean(E), 
    WUE_m = mean(WUE), 
    gsw_m = mean(gsw), 
    cica_m = mean(cica))

# Genotype mean 300
A.300.mean <- clone.300.fin %>%
  select(Clon, A, E, WUE, gsw, cica) %>%
  group_by(Clon) %>%
  summarise(
    A_m = mean(A), 
    E_m = mean(E), 
    WUE_m = mean(WUE), 
    gsw_m = mean(gsw), 
    cica_m = mean(cica))
# Genotype pooled mean 300
A.300.mean.pond <- clone.300.fin %>%
  select(Clon, A, E, WUE, gsw, cica) %>%
  summarise(
    A_m = mean(A), 
    E_m = mean(E), 
    WUE_m = mean(WUE), 
    gsw_m = mean(gsw), 
    cica_m = mean(cica))

# Genotype mean 500
A.500.mean <- clone.500.fin %>%
  select(Clon, A, E, WUE, gsw, cica) %>%
  group_by(Clon) %>%
  summarise(
    A_m = mean(A), 
    E_m = mean(E), 
    WUE_m = mean(WUE), 
    gsw_m = mean(gsw), 
    cica_m = mean(cica))
# Genotype pooled mean 500
A.500.mean.pond <- clone.500.fin %>%
  select(Clon, A, E, WUE, gsw, cica) %>%
  summarise(
    A_m = mean(A), 
    E_m = mean(E), 
    WUE_m = mean(WUE), 
    gsw_m = mean(gsw), 
    cica_m = mean(cica))

# Genotype mean 800
A.800.mean <- clone.800.fin %>%
  select(Clon, A, E, WUE, gsw, cica) %>%
  group_by(Clon) %>%
  summarise(
    A_m = mean(A), 
    E_m = mean(E), 
    WUE_m = mean(WUE), 
    gsw_m = mean(gsw), 
    cica_m = mean(cica))
# Genotype pooled mean 800
A.800.mean.pond <- clone.800.fin %>%
  select(Clon, A, E, WUE, gsw, cica) %>%
  summarise(
    A_m = mean(A), 
    E_m = mean(E), 
    WUE_m = mean(WUE), 
    gsw_m = mean(gsw), 
    cica_m = mean(cica))

# Genotype mean 900
A.900.mean <- clone.900.fin %>%
  select(Clon, A, E, WUE, gsw, cica) %>%
  group_by(Clon) %>%
  summarise(
    A_m = mean(A), 
    E_m = mean(E), 
    WUE_m = mean(WUE), 
    gsw_m = mean(gsw), 
    cica_m = mean(cica))
# Genotype pooled mean 900
A.900.mean.pond <- clone.900.fin %>%
  select(Clon, A, E, WUE, gsw, cica) %>%
  summarise(
    A_m = mean(A), 
    E_m = mean(E), 
    WUE_m = mean(WUE), 
    gsw_m = mean(gsw), 
    cica_m = mean(cica))

# Genotype mean 1200
A.1200.mean <- clone.1200.fin %>%
  select(Clon, A, E, WUE, gsw, cica) %>%
  group_by(Clon) %>%
  summarise(
    A_m = mean(A), 
    E_m = mean(E), 
    WUE_m = mean(WUE), 
    gsw_m = mean(gsw), 
    cica_m = mean(cica))
# Genotype pooled mean 1200
A.1200.mean.pond <- clone.1200.fin %>%
  select(Clon, A, E, WUE, gsw, cica) %>%
  summarise(
    A_m = mean(A), 
    E_m = mean(E), 
    WUE_m = mean(WUE), 
    gsw_m = mean(gsw), 
    cica_m = mean(cica))

# Genotype mean 1500
A.1500.mean <- clone.1500.fin %>%
  select(Clon, A, E, WUE, gsw, cica) %>%
  group_by(Clon) %>%
  summarise(
    A_m = mean(A), 
    E_m = mean(E), 
    WUE_m = mean(WUE), 
    gsw_m = mean(gsw), 
    cica_m = mean(cica))
# Genotype pooled mean 1500
A.1500.mean.pond <- clone.1500.fin %>%
  select(Clon, A, E, WUE, gsw, cica) %>%
  summarise(
    A_m = mean(A), 
    E_m = mean(E), 
    WUE_m = mean(WUE), 
    gsw_m = mean(gsw), 
    cica_m = mean(cica))

# Genotype mean 2000
A.2000.mean <- clone.2000.fin %>%
  select(Clon, A, E, WUE, gsw, cica) %>%
  group_by(Clon) %>%
  summarise(
    A_m = mean(A), 
    E_m = mean(E), 
    WUE_m = mean(WUE), 
    gsw_m = mean(gsw), 
    cica_m = mean(cica))
# Genotype pooled mean 2000
A.2000.mean.pond <- clone.2000.fin %>%
  select(Clon, A, E, WUE, gsw, cica) %>%
  summarise(
    A_m = mean(A), 
    E_m = mean(E), 
    WUE_m = mean(WUE), 
    gsw_m = mean(gsw), 
    cica_m = mean(cica))

## Mean and grand mean tables
# Grand mean tables
# A
A.100.mean.pond
##        A_m      E_m    WUE_m      gsw_m    cica_m
## 1 2.291955 1.577324 1.654262 0.05578251 0.7533489
A.300.mean.pond
##        A_m     E_m    WUE_m      gsw_m   cica_m
## 1 4.219721 1.61974 2.801827 0.05621585 0.601851
A.500.mean.pond
##        A_m      E_m    WUE_m      gsw_m    cica_m
## 1 4.553467 1.642263 2.939552 0.05601538 0.5720501
A.800.mean.pond
##        A_m      E_m   WUE_m      gsw_m    cica_m
## 1 4.676854 1.703282 2.90732 0.05640295 0.5574663
A.900.mean.pond
##        A_m      E_m    WUE_m      gsw_m    cica_m
## 1 4.759056 1.794922 2.817201 0.06010203 0.5689107
A.1200.mean.pond
##        A_m      E_m    WUE_m      gsw_m    cica_m
## 1 5.102638 2.047754 2.623097 0.06900316 0.5853469
A.1500.mean.pond
##        A_m      E_m    WUE_m      gsw_m    cica_m
## 1 5.783435 2.528369 2.403089 0.08625527 0.6151746
A.2000.mean.pond
##       A_m      E_m    WUE_m     gsw_m   cica_m
## 1 6.91928 3.392319 2.133834 0.1161241 0.654072
# Mean tables
# A
A.100.mean
## # A tibble: 20 × 6
##    Clon     A_m   E_m WUE_m  gsw_m cica_m
##    <fct>  <dbl> <dbl> <dbl>  <dbl>  <dbl>
##  1 TCS 01  2.66 1.32   2.25 0.0563  0.753
##  2 TCS 02  2.50 2.29   1.12 0.0857  0.830
##  3 TCS 03  1.82 1.62   1.49 0.0438  0.755
##  4 TCS 04  2.49 1.50   1.77 0.0494  0.730
##  5 TCS 05  1.97 1.04   2.05 0.0332  0.662
##  6 TCS 08  2.17 1.82   1.27 0.0466  0.738
##  7 TCS 10  1.23 0.590  1.98 0.0186  0.671
##  8 TCS 11  2.52 1.94   1.35 0.0770  0.821
##  9 TCS 12  1.51 0.805  1.79 0.0252  0.674
## 10 TCS 20  1.84 1.59   1.47 0.0630  0.814
## 11 TCS 40  2.38 2.07   1.18 0.0690  0.798
## 12 TCS 41  2.77 1.91   1.44 0.0707  0.783
## 13 TCS 42  1.98 1.21   1.67 0.0391  0.714
## 14 TCS 43  2.34 1.66   1.78 0.0496  0.747
## 15 TCS 44  2.58 2.29   1.27 0.0720  0.788
## 16 TCS 45  3.20 1.68   1.92 0.0770  0.770
## 17 TCS 46  2.63 1.64   1.70 0.0603  0.766
## 18 TCS 47  2.47 1.29   2.00 0.0518  0.743
## 19 TCS 48  3.02 2.20   1.43 0.0859  0.807
## 20 TCS 49  1.74 1.07   2.16 0.0415  0.704
A.300.mean
## # A tibble: 20 × 6
##    Clon     A_m   E_m WUE_m  gsw_m cica_m
##    <fct>  <dbl> <dbl> <dbl>  <dbl>  <dbl>
##  1 TCS 01  4.62 1.41   3.60 0.0576  0.608
##  2 TCS 02  5.29 2.27   2.42 0.0826  0.669
##  3 TCS 03  3.54 1.67   3.10 0.0439  0.545
##  4 TCS 04  4.37 1.68   2.80 0.0548  0.593
##  5 TCS 05  3.19 1.08   3.07 0.0337  0.514
##  6 TCS 08  3.85 1.86   2.15 0.0459  0.579
##  7 TCS 10  1.61 0.576  2.64 0.0175  0.566
##  8 TCS 11  4.66 2.01   2.35 0.0788  0.702
##  9 TCS 12  2.31 0.800  2.67 0.0247  0.539
## 10 TCS 20  4.06 1.81   2.19 0.0741  0.716
## 11 TCS 40  4.88 2.04   2.44 0.0658  0.621
## 12 TCS 41  5.19 1.83   2.83 0.0660  0.599
## 13 TCS 42  3.43 1.22   2.84 0.0382  0.540
## 14 TCS 43  4.59 1.71   3.20 0.0497  0.549
## 15 TCS 44  4.98 2.37   2.26 0.0736  0.648
## 16 TCS 45  5.59 1.77   3.19 0.0791  0.632
## 17 TCS 46  4.98 1.69   3.09 0.0609  0.591
## 18 TCS 47  4.21 1.31   3.36 0.0512  0.585
## 19 TCS 48  5.95 2.24   2.74 0.0864  0.656
## 20 TCS 49  3.08 1.05   3.10 0.0399  0.585
A.500.mean
## # A tibble: 20 × 6
##    Clon     A_m   E_m WUE_m  gsw_m cica_m
##    <fct>  <dbl> <dbl> <dbl>  <dbl>  <dbl>
##  1 TCS 01  5.08 1.51   3.64 0.0602  0.589
##  2 TCS 02  5.70 2.18   2.70 0.0770  0.620
##  3 TCS 03  3.94 1.73   3.37 0.0443  0.499
##  4 TCS 04  5.03 1.89   2.87 0.0618  0.579
##  5 TCS 05  3.43 1.12   3.12 0.0343  0.492
##  6 TCS 08  4.11 1.89   2.24 0.0454  0.550
##  7 TCS 10  1.61 0.587  2.57 0.0176  0.571
##  8 TCS 11  4.81 2.03   2.40 0.0817  0.679
##  9 TCS 12  2.36 0.813  2.65 0.0249  0.538
## 10 TCS 20  4.65 1.89   2.38 0.0754  0.682
## 11 TCS 40  5.31 1.96   2.74 0.0614  0.568
## 12 TCS 41  5.45 1.77   3.09 0.0623  0.552
## 13 TCS 42  3.55 1.21   2.97 0.0372  0.509
## 14 TCS 43  5.06 1.74   3.37 0.0490  0.499
## 15 TCS 44  5.52 2.41   2.43 0.0743  0.618
## 16 TCS 45  6.04 1.89   3.22 0.0823  0.618
## 17 TCS 46  5.12 1.61   3.30 0.0572  0.543
## 18 TCS 47  4.49 1.31   3.55 0.0510  0.553
## 19 TCS 48  6.52 2.26   3.01 0.0845  0.615
## 20 TCS 49  3.30 1.04   3.16 0.0385  0.569
A.800.mean
## # A tibble: 20 × 6
##    Clon     A_m   E_m WUE_m  gsw_m cica_m
##    <fct>  <dbl> <dbl> <dbl>  <dbl>  <dbl>
##  1 TCS 01  5.38 1.68   3.44 0.0637  0.587
##  2 TCS 02  5.74 2.15   2.75 0.0727  0.593
##  3 TCS 03  4.18 1.83   3.36 0.0456  0.483
##  4 TCS 04  5.54 2.19   2.75 0.0713  0.586
##  5 TCS 05  3.59 1.19   3.08 0.0349  0.479
##  6 TCS 08  4.21 1.95   2.21 0.0453  0.536
##  7 TCS 10  2.25 0.871  2.50 0.0276  0.565
##  8 TCS 11  4.72 2.06   2.40 0.0839  0.663
##  9 TCS 12  2.39 0.834  2.68 0.0252  0.511
## 10 TCS 20  4.79 1.97   2.36 0.0755  0.665
## 11 TCS 40  4.95 1.78   2.84 0.0522  0.535
## 12 TCS 41  5.58 1.80   3.12 0.0616  0.532
## 13 TCS 42  3.63 1.29   2.88 0.0380  0.502
## 14 TCS 43  5.23 1.77   3.32 0.0484  0.478
## 15 TCS 44  5.76 2.49   2.45 0.0754  0.605
## 16 TCS 45  6.29 2.03   3.10 0.0861  0.616
## 17 TCS 46  5.14 1.64   3.16 0.0567  0.541
## 18 TCS 47  4.46 1.29   3.47 0.0496  0.543
## 19 TCS 48  6.31 2.18   3.12 0.0765  0.578
## 20 TCS 49  3.38 1.07   3.17 0.0378  0.553
A.900.mean
## # A tibble: 20 × 6
##    Clon     A_m   E_m WUE_m  gsw_m cica_m
##    <fct>  <dbl> <dbl> <dbl>  <dbl>  <dbl>
##  1 TCS 01  5.49 1.82   3.23 0.0684  0.604
##  2 TCS 02  5.56 2.14   2.67 0.0717  0.598
##  3 TCS 03  4.25 1.94   3.34 0.0483  0.490
##  4 TCS 04  5.98 2.49   2.63 0.0844  0.609
##  5 TCS 05  3.72 1.27   2.98 0.0370  0.489
##  6 TCS 08  4.23 2.06   2.10 0.0472  0.545
##  7 TCS 10  3.41 1.28   2.43 0.0506  0.595
##  8 TCS 11  4.78 2.18   2.32 0.0905  0.676
##  9 TCS 12  2.58 0.953  2.46 0.0298  0.558
## 10 TCS 20  4.77 1.97   2.38 0.0756  0.661
## 11 TCS 40  4.71 1.75   2.78 0.0503  0.537
## 12 TCS 41  5.61 1.89   2.98 0.0647  0.546
## 13 TCS 42  3.59 1.35   2.73 0.0394  0.518
## 14 TCS 43  5.31 1.85   3.17 0.0505  0.490
## 15 TCS 44  5.77 2.54   2.40 0.0777  0.614
## 16 TCS 45  6.41 2.19   2.92 0.0932  0.634
## 17 TCS 46  5.10 1.69   3.06 0.0582  0.546
## 18 TCS 47  4.42 1.31   3.28 0.0523  0.566
## 19 TCS 48  5.59 2.02   3.13 0.0694  0.558
## 20 TCS 49  3.92 1.20   3.35 0.0431  0.543
A.1200.mean
## # A tibble: 20 × 6
##    Clon     A_m   E_m WUE_m  gsw_m cica_m
##    <fct>  <dbl> <dbl> <dbl>  <dbl>  <dbl>
##  1 TCS 01  5.85  2.15  2.92 0.0786  0.625
##  2 TCS 02  5.63  2.31  2.48 0.0745  0.608
##  3 TCS 03  4.43  2.14  3.13 0.0526  0.506
##  4 TCS 04  6.45  2.91  2.43 0.101   0.633
##  5 TCS 05  4.05  1.45  2.83 0.0409  0.491
##  6 TCS 08  4.38  2.26  1.98 0.0505  0.553
##  7 TCS 10  4.29  1.65  2.34 0.0743  0.608
##  8 TCS 11  5.06  2.49  2.13 0.104   0.702
##  9 TCS 12  3.34  1.38  2.29 0.0467  0.578
## 10 TCS 20  4.87  2.08  2.33 0.0786  0.660
## 11 TCS 40  4.79  1.92  2.57 0.0532  0.547
## 12 TCS 41  5.95  2.14  2.80 0.0715  0.563
## 13 TCS 42  3.60  1.46  2.55 0.0412  0.529
## 14 TCS 43  5.74  2.14  2.95 0.0568  0.504
## 15 TCS 44  5.94  2.74  2.29 0.0839  0.626
## 16 TCS 45  6.59  2.47  2.66 0.106   0.656
## 17 TCS 46  5.29  1.84  2.88 0.0616  0.553
## 18 TCS 47  4.91  1.55  2.98 0.0642  0.606
## 19 TCS 48  5.60  2.16  2.92 0.0736  0.567
## 20 TCS 49  5.29  1.71  2.99 0.0662  0.593
A.1500.mean
## # A tibble: 20 × 6
##    Clon     A_m   E_m WUE_m  gsw_m cica_m
##    <fct>  <dbl> <dbl> <dbl>  <dbl>  <dbl>
##  1 TCS 01  6.73  2.78  2.54 0.104   0.667
##  2 TCS 02  6.28  2.85  2.22 0.0925  0.647
##  3 TCS 03  5.15  2.79  2.74 0.0711  0.562
##  4 TCS 04  6.81  3.33  2.25 0.117   0.655
##  5 TCS 05  4.85  1.88  2.64 0.0517  0.517
##  6 TCS 08  4.79  2.64  1.84 0.0588  0.573
##  7 TCS 10  5.00  2.02  2.26 0.0902  0.612
##  8 TCS 11  6.05  3.38  1.82 0.142   0.756
##  9 TCS 12  4.53  1.97  2.12 0.0674  0.618
## 10 TCS 20  5.21  2.31  2.31 0.0867  0.660
## 11 TCS 40  5.07  2.19  2.37 0.0585  0.561
## 12 TCS 41  8.16  3.40  2.44 0.121   0.646
## 13 TCS 42  3.83  1.68  2.37 0.0471  0.549
## 14 TCS 43  7.07  3.03  2.62 0.0831  0.558
## 15 TCS 44  6.15  3.00  2.15 0.0923  0.642
## 16 TCS 45  6.72  2.84  2.38 0.126   0.682
## 17 TCS 46  5.78  2.13  2.75 0.0686  0.558
## 18 TCS 47  5.48  1.86  2.76 0.0793  0.634
## 19 TCS 48  5.81  2.37  2.67 0.0795  0.585
## 20 TCS 49  6.21  2.13  2.81 0.0877  0.621
A.2000.mean
## # A tibble: 20 × 6
##    Clon     A_m   E_m WUE_m  gsw_m cica_m
##    <fct>  <dbl> <dbl> <dbl>  <dbl>  <dbl>
##  1 TCS 01  8.70  3.86  2.26 0.155   0.703
##  2 TCS 02  7.36  3.83  1.93 0.135   0.700
##  3 TCS 03  6.10  3.69  2.14 0.0992  0.637
##  4 TCS 04  7.05  3.72  2.04 0.127   0.668
##  5 TCS 05  6.58  2.88  2.33 0.0788  0.571
##  6 TCS 08  6.36  4.51  1.56 0.107   0.647
##  7 TCS 10  6.59  2.88  2.18 0.114   0.626
##  8 TCS 11  7.09  4.62  1.58 0.203   0.799
##  9 TCS 12  5.64  2.59  2.04 0.0915  0.635
## 10 TCS 20  6.39  3.10  2.16 0.115   0.687
## 11 TCS 40  5.66  2.76  2.08 0.0721  0.598
## 12 TCS 41  9.65  4.71  2.12 0.178   0.699
## 13 TCS 42  4.55  2.32  2.00 0.0620  0.600
## 14 TCS 43  8.45  3.88  2.35 0.110   0.593
## 15 TCS 44  6.45  3.42  1.95 0.103   0.661
## 16 TCS 45  7.71  3.44  2.25 0.150   0.691
## 17 TCS 46  7.43  2.97  2.51 0.0951  0.590
## 18 TCS 47  6.40  2.44  2.50 0.108   0.661
## 19 TCS 48  6.85  3.28  2.17 0.108   0.652
## 20 TCS 49  7.39  2.94  2.54 0.112   0.660