setwd("~/Library/CloudStorage/GoogleDrive-icarounam@gmail.com/Mi unidad/Agrosavia/Env_muestra/data")
datos<-read.table("granofinmod.csv", header=T, sep=',')
datos$curva <- factor(datos$curva, levels = c("1", "2", "3"), 
                      labels = c("P3", "P1", "P2"))
datos$gen<-as.factor(datos$gen)
datos$curva<-as.factor(datos$curva)
datos$id<-as.factor(datos$id)
datos$muestra<-as.factor(datos$muestra)
datos$diam2<-as.factor(datos$diam2)
library(ggplot2)
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(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
## ✓ tibble  3.1.6     ✓ purrr   0.3.4
## ✓ tidyr   1.1.4     ✓ stringr 1.4.0
## ✓ readr   2.1.1     ✓ forcats 0.5.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::arrange()   masks plyr::arrange()
## x purrr::compact()   masks plyr::compact()
## x dplyr::count()     masks plyr::count()
## x dplyr::failwith()  masks plyr::failwith()
## x dplyr::filter()    masks stats::filter()
## x dplyr::id()        masks plyr::id()
## x dplyr::lag()       masks stats::lag()
## x dplyr::mutate()    masks plyr::mutate()
## x dplyr::rename()    masks plyr::rename()
## x dplyr::summarise() masks plyr::summarise()
## x dplyr::summarize() masks plyr::summarize()
library(ggpubr)
## 
## Attaching package: 'ggpubr'
## The following object is masked from 'package:plyr':
## 
##     mutate
library(rstatix)
## 
## Attaching package: 'rstatix'
## The following objects are masked from 'package:plyr':
## 
##     desc, mutate
## The following object is masked from 'package:stats':
## 
##     filter
##Summary statistics
summ<-datos %>%
  group_by(curva, gen, diam2) %>%
  get_summary_stats(cd.grano.c, type = "mean_sd")
summ %>% as_tibble() %>% print(n=Inf)
## # A tibble: 36 × 7
##    curva gen   diam2 variable       n  mean    sd
##    <fct> <fct> <fct> <chr>      <dbl> <dbl> <dbl>
##  1 P3    CCN51 0     cd.grano.c     3  8.76 0.807
##  2 P3    CCN51 2     cd.grano.c     3  8.23 0.315
##  3 P3    CCN51 5     cd.grano.c     3  7.78 0.312
##  4 P3    CCN51 6     cd.grano.c     3  7.39 0.137
##  5 P3    ICS95 0     cd.grano.c     3 11.8  0.664
##  6 P3    ICS95 2     cd.grano.c     3 11.5  0.69 
##  7 P3    ICS95 5     cd.grano.c     3 10.9  0.43 
##  8 P3    ICS95 6     cd.grano.c     3 10.2  0.624
##  9 P3    TCS01 0     cd.grano.c     3  9.67 1.76 
## 10 P3    TCS01 2     cd.grano.c     3  8.30 0.355
## 11 P3    TCS01 5     cd.grano.c     3  7.78 0.919
## 12 P3    TCS01 6     cd.grano.c     3  7.05 0.342
## 13 P1    CCN51 0     cd.grano.c     3  9.53 0.448
## 14 P1    CCN51 2     cd.grano.c     3  8.37 0.615
## 15 P1    CCN51 5     cd.grano.c     3  7.88 0.551
## 16 P1    CCN51 6     cd.grano.c     3  7.69 0.489
## 17 P1    ICS95 0     cd.grano.c     3 10.0  0.77 
## 18 P1    ICS95 2     cd.grano.c     3  9.63 0.824
## 19 P1    ICS95 5     cd.grano.c     3  9.30 0.831
## 20 P1    ICS95 6     cd.grano.c     3  8.75 1.11 
## 21 P1    TCS01 0     cd.grano.c     3  7.71 1.30 
## 22 P1    TCS01 2     cd.grano.c     3  6.75 0.419
## 23 P1    TCS01 5     cd.grano.c     3  6.55 0.337
## 24 P1    TCS01 6     cd.grano.c     3  6.41 0.396
## 25 P2    CCN51 0     cd.grano.c     3  7.27 0.486
## 26 P2    CCN51 2     cd.grano.c     3  6.98 0.512
## 27 P2    CCN51 5     cd.grano.c     3  6.47 0.139
## 28 P2    CCN51 6     cd.grano.c     3  5.70 0.729
## 29 P2    ICS95 0     cd.grano.c     3 12.2  0.301
## 30 P2    ICS95 2     cd.grano.c     3 11.5  0.228
## 31 P2    ICS95 5     cd.grano.c     3 11.4  0.156
## 32 P2    ICS95 6     cd.grano.c     3 10.8  0.495
## 33 P2    TCS01 0     cd.grano.c     3  8.98 0.476
## 34 P2    TCS01 2     cd.grano.c     3  8.75 0.442
## 35 P2    TCS01 5     cd.grano.c     3  8.21 0.16 
## 36 P2    TCS01 6     cd.grano.c     3  6.69 0.393
##Visualization
bxp <- ggboxplot(
  datos, x = "curva", y = "cd.grano.c",
  color = "diam2", palette = "jco",
  facet.by =  "gen"
)
bxp

##Check assumptions
##Outliers

datos %>%
  group_by(curva, gen, diam2) %>%
  identify_outliers(cd.grano.c)
##  [1] curva      gen        diam2      muestra    id         dia       
##  [7] cd.grano   curva.1    protocolo  gen.1      muestra.1  dia.1     
## [13] diam       Testa      Grano      cd.grano.1 cd.grano.c cd.grano.a
## [19] cd.grano.d is.outlier is.extreme
## <0 rows> (or 0-length row.names)
##Normality assumption
##Compute Shapiro-Wilk test for each combinations of factor levels:
  
norm<-datos %>%
  group_by(curva, gen, diam2) %>%
  shapiro_test(cd.grano.c)
norm %>% as_tibble() %>% print(n=Inf)
## # A tibble: 36 × 6
##    curva gen   diam2 variable   statistic       p
##    <fct> <fct> <fct> <chr>          <dbl>   <dbl>
##  1 P3    CCN51 0     cd.grano.c     0.934 0.504  
##  2 P3    CCN51 2     cd.grano.c     0.913 0.428  
##  3 P3    CCN51 5     cd.grano.c     0.781 0.0705 
##  4 P3    CCN51 6     cd.grano.c     0.904 0.400  
##  5 P3    ICS95 0     cd.grano.c     0.994 0.847  
##  6 P3    ICS95 2     cd.grano.c     0.971 0.672  
##  7 P3    ICS95 5     cd.grano.c     0.774 0.0533 
##  8 P3    ICS95 6     cd.grano.c     0.919 0.449  
##  9 P3    TCS01 0     cd.grano.c     0.991 0.820  
## 10 P3    TCS01 2     cd.grano.c     0.756 0.0134 
## 11 P3    TCS01 5     cd.grano.c     0.824 0.173  
## 12 P3    TCS01 6     cd.grano.c     0.994 0.857  
## 13 P1    CCN51 0     cd.grano.c     0.999 0.940  
## 14 P1    CCN51 2     cd.grano.c     0.857 0.258  
## 15 P1    CCN51 5     cd.grano.c     0.893 0.363  
## 16 P1    CCN51 6     cd.grano.c     0.993 0.836  
## 17 P1    ICS95 0     cd.grano.c     0.978 0.718  
## 18 P1    ICS95 2     cd.grano.c     0.828 0.182  
## 19 P1    ICS95 5     cd.grano.c     0.844 0.226  
## 20 P1    ICS95 6     cd.grano.c     0.785 0.0783 
## 21 P1    TCS01 0     cd.grano.c     0.785 0.0788 
## 22 P1    TCS01 2     cd.grano.c     0.754 0.00911
## 23 P1    TCS01 5     cd.grano.c     0.968 0.658  
## 24 P1    TCS01 6     cd.grano.c     1.00  0.979  
## 25 P2    CCN51 0     cd.grano.c     0.989 0.799  
## 26 P2    CCN51 2     cd.grano.c     0.972 0.678  
## 27 P2    CCN51 5     cd.grano.c     0.946 0.551  
## 28 P2    CCN51 6     cd.grano.c     0.912 0.424  
## 29 P2    ICS95 0     cd.grano.c     0.950 0.567  
## 30 P2    ICS95 2     cd.grano.c     0.986 0.770  
## 31 P2    ICS95 5     cd.grano.c     0.973 0.683  
## 32 P2    ICS95 6     cd.grano.c     0.809 0.135  
## 33 P2    TCS01 0     cd.grano.c     0.813 0.147  
## 34 P2    TCS01 2     cd.grano.c     0.932 0.496  
## 35 P2    TCS01 5     cd.grano.c     0.888 0.349  
## 36 P2    TCS01 6     cd.grano.c     1.00  0.986
##Create QQ plot for each cell of design:
    
    ggqqplot(datos, "cd.grano.c", ggtheme = theme_bw()) +
    facet_grid(diam2~ curva*gen, labeller = "label_both")

##Homogneity of variance assumption
    
##Compute the Levene’s test at each level of the within-subjects factor, here time variable:
      
lev<-datos %>%
      group_by(diam2) %>%
      levene_test(cd.grano.c ~ curva*gen)
lev %>% as_tibble() %>% print(n=Inf)
## # A tibble: 4 × 5
##   diam2   df1   df2 statistic     p
##   <fct> <int> <int>     <dbl> <dbl>
## 1 0         8    18     0.659 0.720
## 2 2         8    18     0.245 0.976
## 3 5         8    18     0.476 0.857
## 4 6         8    18     0.338 0.940
##Computation
      
res.aov <- anova_test(
        data = datos, dv = cd.grano.c, wid = id,
        within = diam2, between = c(curva, gen)
      )
      get_anova_table(res.aov)
## ANOVA Table (type II tests)
## 
##            Effect  DFn   DFd      F        p p<.05   ges
## 1           curva 2.00 18.00  6.595 7.00e-03     * 0.326
## 2             gen 2.00 18.00 95.539 2.60e-10     * 0.875
## 3           diam2 1.68 30.21 71.579 1.76e-11     * 0.576
## 4       curva:gen 4.00 18.00 11.174 9.83e-05     * 0.621
## 5     curva:diam2 3.36 30.21  1.686 1.87e-01       0.060
## 6       gen:diam2 3.36 30.21  1.176 3.38e-01       0.043
## 7 curva:gen:diam2 6.71 30.21  1.286 2.91e-01       0.089
##Splitting dataframe by temperature ramp
## Protocol 3 (P3)

datos.curve1<-filter(datos, curva=="P3")

##Check assumptions
##Outliers

datos.curve1 %>%
  group_by(gen, diam2) %>%
  identify_outliers(cd.grano.c)
##  [1] gen        diam2      curva      muestra    id         dia       
##  [7] cd.grano   curva.1    protocolo  gen.1      muestra.1  dia.1     
## [13] diam       Testa      Grano      cd.grano.1 cd.grano.c cd.grano.a
## [19] cd.grano.d is.outlier is.extreme
## <0 rows> (or 0-length row.names)
##Normality assumption
##Compute Shapiro-Wilk test for each combinations of factor levels:

norm1<-datos.curve1 %>%
  group_by(gen, diam2) %>%
  shapiro_test(cd.grano.c)
norm1 %>% as_tibble() %>% print(n=Inf)
## # A tibble: 12 × 5
##    gen   diam2 variable   statistic      p
##    <fct> <fct> <chr>          <dbl>  <dbl>
##  1 CCN51 0     cd.grano.c     0.934 0.504 
##  2 CCN51 2     cd.grano.c     0.913 0.428 
##  3 CCN51 5     cd.grano.c     0.781 0.0705
##  4 CCN51 6     cd.grano.c     0.904 0.400 
##  5 ICS95 0     cd.grano.c     0.994 0.847 
##  6 ICS95 2     cd.grano.c     0.971 0.672 
##  7 ICS95 5     cd.grano.c     0.774 0.0533
##  8 ICS95 6     cd.grano.c     0.919 0.449 
##  9 TCS01 0     cd.grano.c     0.991 0.820 
## 10 TCS01 2     cd.grano.c     0.756 0.0134
## 11 TCS01 5     cd.grano.c     0.824 0.173 
## 12 TCS01 6     cd.grano.c     0.994 0.857
##Create QQ plot for each cell of design:

ggqqplot(datos.curve1, "cd.grano.c", ggtheme = theme_bw()) +
  facet_grid(diam2~ curva*gen, labeller = "label_both")

##Homogneity of variance assumption

##Compute the Levene’s test at each level of the within-subjects factor, here time variable:

lev1<-datos.curve1 %>%
  group_by(diam2) %>%
  levene_test(cd.grano.c ~ gen)
lev1 %>% as_tibble() %>% print(n=Inf)
## # A tibble: 4 × 5
##   diam2   df1   df2 statistic     p
##   <fct> <int> <int>     <dbl> <dbl>
## 1 0         2     6     0.897 0.456
## 2 2         2     6     0.499 0.630
## 3 5         2     6     0.376 0.701
## 4 6         2     6     0.826 0.482
##Computation

res.aov1 <- anova_test(
  data = datos.curve1, dv = cd.grano.c, wid = id,
  within = diam2, between = gen
)
get_anova_table(res.aov1)
## ANOVA Table (type II tests)
## 
##      Effect DFn DFd      F        p p<.05   ges
## 1       gen   2   6 27.867 9.18e-04     * 0.844
## 2     diam2   3  18 18.299 1.06e-05     * 0.560
## 3 gen:diam2   6  18  1.017 4.45e-01       0.124
#CCN51
datos.ccn<-filter(datos.curve1, gen=="CCN51")
res.aov.ccn1 <- anova_test(
  data = datos.ccn, dv = cd.grano.c, wid = id,
  within = diam2
)
get_anova_table(res.aov.ccn1)
## ANOVA Table (type III tests)
## 
##   Effect DFn DFd     F    p p<.05   ges
## 1  diam2   3   6 6.034 0.03     * 0.645
#ICS95
datos.ics<-filter(datos.curve1, gen=="ICS95")
res.aov.ics1 <- anova_test(
  data = datos.ics, dv = cd.grano.c, wid = id,
  within = diam2
)
get_anova_table(res.aov.ics1)
## ANOVA Table (type III tests)
## 
##   Effect DFn DFd     F     p p<.05  ges
## 1  diam2   3   6 6.312 0.028     * 0.59
#TCS01
datos.tcs<-filter(datos.curve1, gen=="TCS01")
res.aov.tcs1 <- anova_test(
  data = datos.tcs, dv = cd.grano.c, wid = id,
  within = diam2
)
get_anova_table(res.aov.tcs1)
## ANOVA Table (type III tests)
## 
##   Effect DFn DFd     F    p p<.05  ges
## 1  diam2   3   6 7.238 0.02     * 0.57
## Protocol 1 (P1)

datos.curve2<-filter(datos, curva=="P1")

##Check assumptions
##Outliers

datos.curve2 %>%
  group_by(gen, diam2) %>%
  identify_outliers(cd.grano.c)
##  [1] gen        diam2      curva      muestra    id         dia       
##  [7] cd.grano   curva.1    protocolo  gen.1      muestra.1  dia.1     
## [13] diam       Testa      Grano      cd.grano.1 cd.grano.c cd.grano.a
## [19] cd.grano.d is.outlier is.extreme
## <0 rows> (or 0-length row.names)
##Normality assumption
##Compute Shapiro-Wilk test for each combinations of factor levels:

norm2<-datos.curve2 %>%
  group_by(gen, diam2) %>%
  shapiro_test(cd.grano.c)
norm2 %>% as_tibble() %>% print(n=Inf)
## # A tibble: 12 × 5
##    gen   diam2 variable   statistic       p
##    <fct> <fct> <chr>          <dbl>   <dbl>
##  1 CCN51 0     cd.grano.c     0.999 0.940  
##  2 CCN51 2     cd.grano.c     0.857 0.258  
##  3 CCN51 5     cd.grano.c     0.893 0.363  
##  4 CCN51 6     cd.grano.c     0.993 0.836  
##  5 ICS95 0     cd.grano.c     0.978 0.718  
##  6 ICS95 2     cd.grano.c     0.828 0.182  
##  7 ICS95 5     cd.grano.c     0.844 0.226  
##  8 ICS95 6     cd.grano.c     0.785 0.0783 
##  9 TCS01 0     cd.grano.c     0.785 0.0788 
## 10 TCS01 2     cd.grano.c     0.754 0.00911
## 11 TCS01 5     cd.grano.c     0.968 0.658  
## 12 TCS01 6     cd.grano.c     1.00  0.979
##Create QQ plot for each cell of design:

ggqqplot(datos.curve2, "cd.grano.c", ggtheme = theme_bw()) +
  facet_grid(diam2~ curva*gen, labeller = "label_both")

##Homogneity of variance assumption

##Compute the Levene’s test at each level of the within-subjects factor, here time variable:

lev2<-datos.curve2 %>%
  group_by(diam2) %>%
  levene_test(cd.grano.c ~ gen)
lev2 %>% as_tibble() %>% print(n=Inf)
## # A tibble: 4 × 5
##   diam2   df1   df2 statistic     p
##   <fct> <int> <int>     <dbl> <dbl>
## 1 0         2     6     0.271 0.772
## 2 2         2     6     0.151 0.863
## 3 5         2     6     0.249 0.787
## 4 6         2     6     0.319 0.739
##Computation

res.aov2 <- anova_test(
  data = datos.curve2, dv = cd.grano.c, wid = id,
  within = diam2, between = gen
)
get_anova_table(res.aov2)
## ANOVA Table (type II tests)
## 
##      Effect  DFn DFd      F     p p<.05   ges
## 1       gen 2.00 6.0 12.534 0.007     * 0.756
## 2     diam2 1.13 6.8 19.749 0.003     * 0.458
## 3 gen:diam2 2.27 6.8  0.861 0.477       0.069
#CCN51
datos.ccn<-filter(datos.curve2, gen=="CCN51")
res.aov.ccn2 <- anova_test(
  data = datos.ccn, dv = cd.grano.c, wid = id,
  within = diam2
)
get_anova_table(res.aov.ccn2)
## ANOVA Table (type III tests)
## 
##   Effect DFn DFd      F     p p<.05   ges
## 1  diam2   3   6 19.176 0.002     * 0.733
#ICS95
datos.ics<-filter(datos.curve2, gen=="ICS95")
res.aov.ics2 <- anova_test(
  data = datos.ics, dv = cd.grano.c, wid = id,
  within = diam2
)
get_anova_table(res.aov.ics2)
## ANOVA Table (type III tests)
## 
##   Effect DFn DFd      F     p p<.05   ges
## 1  diam2   3   6 18.459 0.002     * 0.288
#TCS01
datos.tcs<-filter(datos.curve2, gen=="TCS01")
res.aov.tcs2 <- anova_test(
  data = datos.tcs, dv = cd.grano.c, wid = id,
  within = diam2
)
get_anova_table(res.aov.tcs2)
## ANOVA Table (type III tests)
## 
##   Effect DFn DFd     F     p p<.05   ges
## 1  diam2   3   6 2.592 0.148       0.421
## Protocol 2 (P2)

datos.curve3<-filter(datos, curva=="P2")

##Check assumptions
##Outliers

datos.curve3 %>%
  group_by(gen, diam2) %>%
  identify_outliers(cd.grano.c)
##  [1] gen        diam2      curva      muestra    id         dia       
##  [7] cd.grano   curva.1    protocolo  gen.1      muestra.1  dia.1     
## [13] diam       Testa      Grano      cd.grano.1 cd.grano.c cd.grano.a
## [19] cd.grano.d is.outlier is.extreme
## <0 rows> (or 0-length row.names)
##Normality assumption
##Compute Shapiro-Wilk test for each combinations of factor levels:

norm2<-datos.curve3 %>%
  group_by(gen, diam2) %>%
  shapiro_test(cd.grano.c)
norm2 %>% as_tibble() %>% print(n=Inf)
## # A tibble: 12 × 5
##    gen   diam2 variable   statistic     p
##    <fct> <fct> <chr>          <dbl> <dbl>
##  1 CCN51 0     cd.grano.c     0.989 0.799
##  2 CCN51 2     cd.grano.c     0.972 0.678
##  3 CCN51 5     cd.grano.c     0.946 0.551
##  4 CCN51 6     cd.grano.c     0.912 0.424
##  5 ICS95 0     cd.grano.c     0.950 0.567
##  6 ICS95 2     cd.grano.c     0.986 0.770
##  7 ICS95 5     cd.grano.c     0.973 0.683
##  8 ICS95 6     cd.grano.c     0.809 0.135
##  9 TCS01 0     cd.grano.c     0.813 0.147
## 10 TCS01 2     cd.grano.c     0.932 0.496
## 11 TCS01 5     cd.grano.c     0.888 0.349
## 12 TCS01 6     cd.grano.c     1.00  0.986
##Create QQ plot for each cell of design:

ggqqplot(datos.curve3, "cd.grano.c", ggtheme = theme_bw()) +
  facet_grid(diam2~ curva*gen, labeller = "label_both")

##Homogneity of variance assumption

##Compute the Levene’s test at each level of the within-subjects factor, here time variable:

lev2<-datos.curve3 %>%
  group_by(diam2) %>%
  levene_test(cd.grano.c ~ gen)
lev2 %>% as_tibble() %>% print(n=Inf)
## # A tibble: 4 × 5
##   diam2   df1   df2 statistic     p
##   <fct> <int> <int>     <dbl> <dbl>
## 1 0         2     6    0.122  0.887
## 2 2         2     6    0.363  0.710
## 3 5         2     6    0.0112 0.989
## 4 6         2     6    0.187  0.834
##Computation

res.aov2 <- anova_test(
  data = datos.curve3, dv = cd.grano.c, wid = id,
  within = diam2, between = gen
)
get_anova_table(res.aov2)
## ANOVA Table (type II tests)
## 
##      Effect DFn DFd       F        p p<.05   ges
## 1       gen   2   6 169.964 5.22e-06     * 0.973
## 2     diam2   3  18  60.864 1.27e-09     * 0.787
## 3 gen:diam2   6  18   2.952 3.50e-02     * 0.263
#CCN51
datos.ccn<-filter(datos.curve3, gen=="CCN51")
res.aov.ccn2 <- anova_test(
  data = datos.ccn, dv = cd.grano.c, wid = id,
  within = diam2
)
get_anova_table(res.aov.ccn2)
## ANOVA Table (type III tests)
## 
##   Effect DFn DFd      F     p p<.05   ges
## 1  diam2   3   6 14.126 0.004     * 0.668
#ICS95
datos.ics<-filter(datos.curve3, gen=="ICS95")
res.aov.ics2 <- anova_test(
  data = datos.ics, dv = cd.grano.c, wid = id,
  within = diam2
)
get_anova_table(res.aov.ics2)
## ANOVA Table (type III tests)
## 
##   Effect DFn DFd     F     p p<.05   ges
## 1  diam2   3   6 8.365 0.015     * 0.777
#TCS01
datos.tcs<-filter(datos.curve3, gen=="TCS01")
res.aov.tcs2 <- anova_test(
  data = datos.tcs, dv = cd.grano.c, wid = id,
  within = diam2
)
get_anova_table(res.aov.tcs2)
## ANOVA Table (type III tests)
## 
##   Effect DFn DFd      F        p p<.05   ges
## 1  diam2   3   6 90.215 2.21e-05     * 0.888
## Gráficas por réplica y genotipo
datos$diam2<-as.numeric(as.character(datos$diam2))
##Gráfica por réplica compuesta
pht<- ggplot(datos, aes(x = diam2)) +
  facet_grid(curva~gen*muestra) +
  geom_line(aes(y=cd.grano.c)) +
  geom_point(aes(y=cd.grano.c)) +
  scale_y_continuous(name = expression("Cd (mg*Kg"^"-1)")) +  # Etiqueta de la variable continua
  scale_x_continuous(name = "día", breaks=seq(0,7,1)) + # Etiqueta de los grupos
  theme(axis.line = element_line(colour = "black", # Personalización del tema
                                 size = 0.25)) +
  theme(text = element_text(size = 12))
pht

## Gráfica por genotipo

datos2<-summarySE (datos, measurevar = "cd.grano.c", groupvars = c("curva", "gen","diam2"))
write.csv(datos2, "~/Library/CloudStorage/GoogleDrive-icarounam@gmail.com/Mi unidad/Agrosavia/Env_muestra/data/datos_mean_grano.csv")

pht2<- ggplot(datos2, aes(x = diam2)) +
  facet_grid(curva~gen) +
  geom_errorbar(aes(ymin=cd.grano.c-ci, ymax=cd.grano.c+ci), width=.1) +
  geom_line(aes(y=cd.grano.c)) +
  geom_point(aes(y=cd.grano.c)) +
  scale_y_continuous(name = expression("Cd (mg*Kg"^"-1)")) +  # Etiqueta de la variable continua
  scale_x_continuous(name = "día", breaks=seq(0,7,1)) + # Etiqueta de los grupos
  theme(axis.line = element_line(colour = "black", # Personalización del tema
                                 size = 0.25)) +
  theme(text = element_text(size = 15))  
pht2