The seeds were sterilized in 50% bleach for 10 min, then rinsed 5 times with dionized water, and incubated at 4 °C overnight. Then seeds were germinated in ¼ MS control with vitamins plate for 4 days in growth chamber. At d5, the seedlings were transferred to either 100 mM salt or control plates, and started being scanned for 5 total consecutive days (starting from d5 to d9). The growth chamber condition was 26 °C and 19 h light /5 h dark cycle, with 60% humidity (Chamber #35).The root tracing was done using ImageJ SamrtRoot plugin by Trent Donaldson. Shoot and root fresh weight were measured after 10 d at salt and then dried and sent for ICP-MS analysis.This F1 created by crossing LA1511 to M248.

getwd()
## [1] "C:/Users/Julkowska Lab/Desktop/R codes by Maryam/20230118_F1__FW_DW_ICP_plate_100mM_Salt"
list.files(pattern = ".csv")
## [1] "20230118_FW_RSA_M248M058LA1511_F1_Salt.csv"      
## [2] "20230612_DW_ICP_M248M058LA1511_F1_Salt_for_R.csv"
ICP_F1 <- read.csv("20230612_DW_ICP_M248M058LA1511_F1_Salt_for_R.csv")
ICP_F1
ICP_F1$All.ID<-paste(ICP_F1$Accession,ICP_F1$Condition, ICP_F1$Tissue, sep="_")
ICP_F1
library(ggplot2)
library(ggpubr)
library(multcompView)
## Warning: package 'multcompView' was built under R version 4.3.2
aov(Na.con.mg.mg.dry.weight ~ All.ID, data = ICP_F1)
## Call:
##    aov(formula = Na.con.mg.mg.dry.weight ~ All.ID, data = ICP_F1)
## 
## Terms:
##                   All.ID Residuals
## Sum of Squares  79716.08   6814.89
## Deg. of Freedom       15       131
## 
## Residual standard error: 7.212631
## Estimated effects may be unbalanced
Output <- TukeyHSD(aov(Na.con.mg.mg.dry.weight ~ All.ID, data = ICP_F1))
Output
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = Na.con.mg.mg.dry.weight ~ All.ID, data = ICP_F1)
## 
## $All.ID
##                                  diff        lwr         upr     p adj
## F1_C_SH-F1_C_RO           0.884276130 -10.994925  12.7634776 1.0000000
## F1_S_RO-F1_C_RO          37.469975756  25.891562  49.0483891 0.0000000
## F1_S_SH-F1_C_RO          53.586460363  42.008047  65.1648737 0.0000000
## LA1511_C_RO-F1_C_RO       3.288868732  -8.037505  14.6152429 0.9997149
## LA1511_C_SH-F1_C_RO       0.405166690 -11.173247  11.9835800 1.0000000
## LA1511_S_RO-F1_C_RO      32.706677906  20.827476  44.5858793 0.0000000
## LA1511_S_SH-F1_C_RO      41.741014004  30.162601  53.3194273 0.0000000
## M058_C_RO-F1_C_RO        -0.213973709 -11.792387  11.3644396 1.0000000
## M058_C_SH-F1_C_RO         0.797009906 -10.781403  12.3754232 1.0000000
## M058_S_RO-F1_C_RO        53.247274565  39.191614  67.3029353 0.0000000
## M058_S_SH-F1_C_RO        47.907126113  34.625775  61.1884771 0.0000000
## M248_C_RO-F1_C_RO        -0.001124042 -11.579537  11.5772893 1.0000000
## M248_C_SH-F1_C_RO         1.092847858 -10.485565  12.6712612 1.0000000
## M248_S_RO-F1_C_RO        46.425104290  34.545903  58.3043057 0.0000000
## M248_S_SH-F1_C_RO        59.452869603  47.573668  71.3320710 0.0000000
## F1_S_RO-F1_C_SH          36.585699626  25.007286  48.1641130 0.0000000
## F1_S_SH-F1_C_SH          52.702184233  41.123771  64.2805976 0.0000000
## LA1511_C_RO-F1_C_SH       2.404592602  -8.921782  13.7309668 0.9999948
## LA1511_C_SH-F1_C_SH      -0.479109440 -12.057523  11.0993039 1.0000000
## LA1511_S_RO-F1_C_SH      31.822401776  19.943200  43.7016032 0.0000000
## LA1511_S_SH-F1_C_SH      40.856737874  29.278325  52.4351512 0.0000000
## M058_C_RO-F1_C_SH        -1.098249839 -12.676663  10.4801635 1.0000000
## M058_C_SH-F1_C_SH        -0.087266224 -11.665680  11.4911471 1.0000000
## M058_S_RO-F1_C_SH        52.362998435  38.307338  66.4186591 0.0000000
## M058_S_SH-F1_C_SH        47.022849983  33.741499  60.3042009 0.0000000
## M248_C_RO-F1_C_SH        -0.885400172 -12.463814  10.6930132 1.0000000
## M248_C_SH-F1_C_SH         0.208571728 -11.369842  11.7869851 1.0000000
## M248_S_RO-F1_C_SH        45.540828161  33.661627  57.4200296 0.0000000
## M248_S_SH-F1_C_SH        58.568593473  46.689392  70.4477949 0.0000000
## F1_S_SH-F1_S_RO          16.116484607   4.846885  27.3860846 0.0002023
## LA1511_C_RO-F1_S_RO     -34.181107023 -45.191601 -23.1706129 0.0000000
## LA1511_C_SH-F1_S_RO     -37.064809065 -48.334409 -25.7952091 0.0000000
## LA1511_S_RO-F1_S_RO      -4.763297850 -16.341711   6.8151155 0.9870978
## LA1511_S_SH-F1_S_RO       4.271038248  -6.998562  15.5406382 0.9943053
## M058_C_RO-F1_S_RO       -37.683949464 -48.953549 -26.4143495 0.0000000
## M058_C_SH-F1_S_RO       -36.672965850 -47.942566 -25.4033659 0.0000000
## M058_S_RO-F1_S_RO        15.777298809   1.974914  29.5796836 0.0099978
## M058_S_SH-F1_S_RO        10.437150357  -2.575863  23.4501635 0.2812076
## M248_C_RO-F1_S_RO       -37.471099797 -48.740700 -26.2014998 0.0000000
## M248_C_SH-F1_S_RO       -36.377127898 -47.646728 -25.1075279 0.0000000
## M248_S_RO-F1_S_RO         8.955128535  -2.623285  20.5335419 0.3407924
## M248_S_SH-F1_S_RO        21.982893847  10.404481  33.5613072 0.0000001
## LA1511_C_RO-F1_S_SH     -50.297591630 -61.308086 -39.2870975 0.0000000
## LA1511_C_SH-F1_S_SH     -53.181293672 -64.450894 -41.9116937 0.0000000
## LA1511_S_RO-F1_S_SH     -20.879782457 -32.458196  -9.3013691 0.0000005
## LA1511_S_SH-F1_S_SH     -11.845446359 -23.115046  -0.5758464 0.0290113
## M058_C_RO-F1_S_SH       -53.800434071 -65.070034 -42.5308341 0.0000000
## M058_C_SH-F1_S_SH       -52.789450457 -64.059050 -41.5198505 0.0000000
## M058_S_RO-F1_S_SH        -0.339185798 -14.141571  13.4631990 1.0000000
## M058_S_SH-F1_S_SH        -5.679334250 -18.692347   7.3336789 0.9775833
## M248_C_RO-F1_S_SH       -53.587584404 -64.857184 -42.3179844 0.0000000
## M248_C_SH-F1_S_SH       -52.493612505 -63.763213 -41.2240125 0.0000000
## M248_S_RO-F1_S_SH        -7.161356072 -18.739769   4.4170573 0.7220008
## M248_S_SH-F1_S_SH         5.866409240  -5.712004  17.4448226 0.9223365
## LA1511_C_SH-LA1511_C_RO  -2.883702042 -13.894196   8.1267921 0.9999201
## LA1511_S_RO-LA1511_C_RO  29.417809174  18.091435  40.7441833 0.0000000
## LA1511_S_SH-LA1511_C_RO  38.452145271  27.441651  49.4626394 0.0000000
## M058_C_RO-LA1511_C_RO    -3.502842441 -14.513337   7.5076517 0.9991620
## M058_C_SH-LA1511_C_RO    -2.491858827 -13.502353   8.5186353 0.9999878
## M058_S_RO-LA1511_C_RO    49.958405832  36.366757  63.5500548 0.0000000
## M058_S_SH-LA1511_C_RO    44.618257380  31.828980  57.4075345 0.0000000
## M248_C_RO-LA1511_C_RO    -3.289992774 -14.300487   7.7205013 0.9995982
## M248_C_SH-LA1511_C_RO    -2.196020875 -13.206515   8.8144732 0.9999977
## M248_S_RO-LA1511_C_RO    43.136235558  31.809861  54.4626097 0.0000000
## M248_S_SH-LA1511_C_RO    56.164000870  44.837627  67.4903750 0.0000000
## LA1511_S_RO-LA1511_C_SH  32.301511216  20.723098  43.8799246 0.0000000
## LA1511_S_SH-LA1511_C_SH  41.335847313  30.066247  52.6054473 0.0000000
## M058_C_RO-LA1511_C_SH    -0.619140399 -11.888740  10.6504596 1.0000000
## M058_C_SH-LA1511_C_SH     0.391843215 -10.877757  11.6614432 1.0000000
## M058_S_RO-LA1511_C_SH    52.842107874  39.039723  66.6444927 0.0000000
## M058_S_SH-LA1511_C_SH    47.501959422  34.488946  60.5149726 0.0000000
## M248_C_RO-LA1511_C_SH    -0.406290732 -11.675891  10.8633093 1.0000000
## M248_C_SH-LA1511_C_SH     0.687681167 -10.581919  11.9572812 1.0000000
## M248_S_RO-LA1511_C_SH    46.019937600  34.441524  57.5983509 0.0000000
## M248_S_SH-LA1511_C_SH    59.047702912  47.469290  70.6261163 0.0000000
## LA1511_S_SH-LA1511_S_RO   9.034336098  -2.544077  20.6127494 0.3259665
## M058_C_RO-LA1511_S_RO   -32.920651615 -44.499065 -21.3422383 0.0000000
## M058_C_SH-LA1511_S_RO   -31.909668000 -43.488081 -20.3312547 0.0000000
## M058_S_RO-LA1511_S_RO    20.540596659   6.484936  34.5962574 0.0001266
## M058_S_SH-LA1511_S_RO    15.200448207   1.919097  28.4817992 0.0098280
## M248_C_RO-LA1511_S_RO   -32.707801948 -44.286215 -21.1293886 0.0000000
## M248_C_SH-LA1511_S_RO   -31.613830048 -43.192243 -20.0354167 0.0000000
## M248_S_RO-LA1511_S_RO    13.718426384   1.839225  25.5976278 0.0086630
## M248_S_SH-LA1511_S_RO    26.746191697  14.866990  38.6253931 0.0000000
## M058_C_RO-LA1511_S_SH   -41.954987712 -53.224588 -30.6853877 0.0000000
## M058_C_SH-LA1511_S_SH   -40.944004098 -52.213604 -29.6744041 0.0000000
## M058_S_RO-LA1511_S_SH    11.506260561  -2.296124  25.3086454 0.2233665
## M058_S_SH-LA1511_S_SH     6.166112109  -6.846901  19.1791253 0.9542595
## M248_C_RO-LA1511_S_SH   -41.742138045 -53.011738 -30.4725380 0.0000000
## M248_C_SH-LA1511_S_SH   -40.648166146 -51.917766 -29.3785661 0.0000000
## M248_S_RO-LA1511_S_SH     4.684090287  -6.894323  16.2625036 0.9890329
## M248_S_SH-LA1511_S_SH    17.711855599   6.133442  29.2902689 0.0000443
## M058_C_SH-M058_C_RO       1.010983614 -10.258616  12.2805836 1.0000000
## M058_S_RO-M058_C_RO      53.461248273  39.658863  67.2636331 0.0000000
## M058_S_SH-M058_C_RO      48.121099821  35.108087  61.1341130 0.0000000
## M248_C_RO-M058_C_RO       0.212849667 -11.056750  11.4824497 1.0000000
## M248_C_SH-M058_C_RO       1.306821566  -9.962778  12.5764216 1.0000000
## M248_S_RO-M058_C_RO      46.639077999  35.060665  58.2174913 0.0000000
## M248_S_SH-M058_C_RO      59.666843311  48.088430  71.2452566 0.0000000
## M058_S_RO-M058_C_SH      52.450264659  38.647880  66.2526495 0.0000000
## M058_S_SH-M058_C_SH      47.110116207  34.097103  60.1231294 0.0000000
## M248_C_RO-M058_C_SH      -0.798133948 -12.067734  10.4714660 1.0000000
## M248_C_SH-M058_C_SH       0.295837952 -10.973762  11.5654379 1.0000000
## M248_S_RO-M058_C_SH      45.628094385  34.049681  57.2065077 0.0000000
## M248_S_SH-M058_C_SH      58.655859697  47.077446  70.2342730 0.0000000
## M058_S_SH-M058_S_RO      -5.340148452 -20.599259   9.9189621 0.9975549
## M248_C_RO-M058_S_RO     -53.248398606 -67.050783 -39.4460138 0.0000000
## M248_C_SH-M058_S_RO     -52.154426707 -65.956812 -38.3520419 0.0000000
## M248_S_RO-M058_S_RO      -6.822170274 -20.877831   7.2334904 0.9443857
## M248_S_SH-M058_S_RO       6.205595038  -7.850066  20.2612557 0.9751238
## M248_C_RO-M058_S_SH     -47.908250154 -60.921263 -34.8952370 0.0000000
## M248_C_SH-M058_S_SH     -46.814278255 -59.827291 -33.8012651 0.0000000
## M248_S_RO-M058_S_SH      -1.482021822 -14.763373  11.7993291 1.0000000
## M248_S_SH-M058_S_SH      11.545743490  -1.735607  24.8270945 0.1684625
## M248_C_SH-M248_C_RO       1.093971899 -10.175628  12.3635719 1.0000000
## M248_S_RO-M248_C_RO      46.426228332  34.847815  58.0046417 0.0000000
## M248_S_SH-M248_C_RO      59.453993644  47.875580  71.0324070 0.0000000
## M248_S_RO-M248_C_SH      45.332256433  33.753843  56.9106698 0.0000000
## M248_S_SH-M248_C_SH      58.360021745  46.781608  69.9384351 0.0000000
## M248_S_SH-M248_S_RO      13.027765312   1.148564  24.9069667 0.0173357
P6 = Output$All.ID[,'p adj']
stat.test<- multcompLetters(P6)
stat.test
##     F1_C_SH     F1_S_RO     F1_S_SH LA1511_C_RO LA1511_C_SH LA1511_S_RO 
##         "a"        "bc"        "de"         "a"         "a"         "b" 
## LA1511_S_SH   M058_C_RO   M058_C_SH   M058_S_RO   M058_S_SH   M248_C_RO 
##       "bcf"         "a"         "a"       "def"      "cdef"         "a" 
##   M248_C_SH   M248_S_RO   M248_S_SH     F1_C_RO 
##         "a"       "cdf"         "e"         "a"
test <- as.data.frame(stat.test$Letters)
test$group1 <- rownames(test)
test$group2 <- rownames(test)
colnames(test)[1] <- "Tukey"
test
###################################################################
test$info <- strsplit(test$group1, "_")
test$info[[1]][2]
## [1] "C"
test$info[[1]][3]
## [1] "SH"
test$Accession <- "none"
test$Condition <- "none"
test$Tissue<- "none"
test
for(i in 1:nrow(test)){
  test$Accession[i] <- test$info[[i]][1]
  test$Condition[i] <- test$info[[i]][2]
  test$Tissue[i] <- test$info[[i]][3]
  
}

test2 <- test[,c(5:7,1)]
test2$group1 <- test2$Accession
test2$group2 <- test2$Accession

ICP_F1
#ICP_F1$Condition<- factor(ICP_F1$Condition, levels=c("C", "S"))
ICP_F1$Accession<- factor(ICP_F1$Accession, levels=c("LA1511", "M058", "M248", "F1" ))

Na_content_F1 <- ggplot(data = ICP_F1, mapping = aes(x = All.ID, y = Na.con.mg.mg.dry.weight, colour = Condition)) 
Na_content_F1  <- Na_content_F1  + geom_boxplot(alpha=0.2) + geom_jitter(width=0.1,alpha=0.2)
Na_content_F1  <- Na_content_F1  + stat_summary(fun=mean, geom="point", shape=95, size=6, color="black", fill="black")
Na_content_F1  <- Na_content_F1  + scale_color_manual(values = c("blue","red"))
Na_content_F1  <- Na_content_F1  + ylab("Na content, mg/mg dry weight") + xlab("")
Na_content_F1  <- Na_content_F1  + theme(axis.text.x = element_text(angle=90, hjust=0.9, vjust=0.5))
Na_content_F1  <- Na_content_F1  + stat_pvalue_manual(test, label = "Tukey", y.position = 120) + rremove("legend")
Na_content_F1 

pdf("Na.accumulation.F1.ICPMS.pdf", height = 5, width = 10)
plot(Na_content_F1)
dev.off()
## png 
##   2
Na_content_F1 <- ggplot(data = ICP_F1, mapping = aes(x = Accession, y = Na.con.mg.mg.dry.weight, colour = Accession)) 
Na_content_F1 <- Na_content_F1 + geom_boxplot(alpha=0.2) + geom_jitter(width=0.1,alpha=0.2)

Na_content_F1 <- Na_content_F1 + facet_grid(Tissue ~ Condition)

Na_content_F1 <- Na_content_F1 + stat_summary(fun=mean, geom="point", shape=95, size=6, color="black", fill="black")
Na_content_F1 <- Na_content_F1 + scale_color_manual(values = c("royalblue", "coral3", "deeppink", "green"))
Na_content_F1 <- Na_content_F1 + ylab("Na content, mg/mg dry weight") + xlab("")+ stat_pvalue_manual(test2, label = "Tukey", y.position = 80)
Na_content_F1 <- Na_content_F1 + theme(axis.text.x = element_text(angle=90, hjust=0.9, vjust=0.5))
Na_content_F1 <- Na_content_F1 + rremove("legend")
Na_content_F1

aov(K.con..mg.mg.dry.weight ~ All.ID, data = ICP_F1)
## Call:
##    aov(formula = K.con..mg.mg.dry.weight ~ All.ID, data = ICP_F1)
## 
## Terms:
##                   All.ID Residuals
## Sum of Squares  72800.28  13312.69
## Deg. of Freedom       15       131
## 
## Residual standard error: 10.08085
## Estimated effects may be unbalanced
Output <- TukeyHSD(aov(K.con..mg.mg.dry.weight ~ All.ID, data = ICP_F1))
Output
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = K.con..mg.mg.dry.weight ~ All.ID, data = ICP_F1)
## 
## $All.ID
##                                diff          lwr        upr     p adj
## F1_C_SH-F1_C_RO           0.7717302 -15.83142929  17.374890 1.0000000
## F1_S_RO-F1_C_RO         -28.6981286 -44.88088669 -12.515370 0.0000008
## F1_S_SH-F1_C_RO         -50.6417320 -66.82449017 -34.458974 0.0000000
## LA1511_C_RO-F1_C_RO       5.0515751 -10.77891637  20.882067 0.9991321
## LA1511_C_SH-F1_C_RO     -19.6727953 -35.85555339  -3.490037 0.0040237
## LA1511_S_RO-F1_C_RO     -34.5144669 -51.11762642 -17.911307 0.0000000
## LA1511_S_SH-F1_C_RO     -52.2670946 -68.44985271 -36.084336 0.0000000
## M058_C_RO-F1_C_RO         5.8049599 -10.37779822  21.987718 0.9968064
## M058_C_SH-F1_C_RO        -5.2268255 -21.40958360  10.955933 0.9990028
## M058_S_RO-F1_C_RO       -32.1050668 -51.75019009 -12.459944 0.0000084
## M058_S_SH-F1_C_RO       -58.5467233 -77.10961995 -39.983827 0.0000000
## M248_C_RO-F1_C_RO         0.6607427 -15.52201544  16.843501 1.0000000
## M248_C_SH-F1_C_RO       -26.3682089 -42.55096698 -10.185451 0.0000091
## M248_S_RO-F1_C_RO       -30.3503160 -46.95347549 -13.747156 0.0000003
## M248_S_SH-F1_C_RO       -57.7066139 -74.30977343 -41.103454 0.0000000
## F1_S_RO-F1_C_SH         -29.4698588 -45.65261690 -13.287101 0.0000004
## F1_S_SH-F1_C_SH         -51.4134623 -67.59622039 -35.230704 0.0000000
## LA1511_C_RO-F1_C_SH       4.2798449 -11.55064659  20.110336 0.9998811
## LA1511_C_SH-F1_C_SH     -20.4445255 -36.62728361  -4.261767 0.0021468
## LA1511_S_RO-F1_C_SH     -35.2861971 -51.88935664 -18.683038 0.0000000
## LA1511_S_SH-F1_C_SH     -53.0388248 -69.22158292 -36.856067 0.0000000
## M058_C_RO-F1_C_SH         5.0332297 -11.14952844  21.215988 0.9993554
## M058_C_SH-F1_C_SH        -5.9985557 -22.18131382  10.184202 0.9954775
## M058_S_RO-F1_C_SH       -32.8767970 -52.52192031 -13.231674 0.0000044
## M058_S_SH-F1_C_SH       -59.3184535 -77.88135017 -40.755557 0.0000000
## M248_C_RO-F1_C_SH        -0.1109875 -16.29374566  16.071771 1.0000000
## M248_C_SH-F1_C_SH       -27.1399391 -43.32269720 -10.957181 0.0000041
## M248_S_RO-F1_C_SH       -31.1220462 -47.72520571 -14.518887 0.0000001
## M248_S_SH-F1_C_SH       -58.4783441 -75.08150365 -41.875185 0.0000000
## F1_S_SH-F1_S_RO         -21.9436035 -37.69474361  -6.192463 0.0003485
## LA1511_C_RO-F1_S_RO      33.7497036  18.36070710  49.138700 0.0000000
## LA1511_C_SH-F1_S_RO       9.0253333  -6.72580683  24.776473 0.8197451
## LA1511_S_RO-F1_S_RO      -5.8163384 -21.99909647  10.366420 0.9967386
## LA1511_S_SH-F1_S_RO     -23.5689660 -39.32010614  -7.817826 0.0000743
## M058_C_RO-F1_S_RO        34.5030885  18.75194834  50.254229 0.0000000
## M058_C_SH-F1_S_RO        23.4713031   7.72016296  39.222443 0.0000817
## M058_S_RO-F1_S_RO        -3.4069383 -22.69806635  15.884190 0.9999996
## M058_S_SH-F1_S_RO       -29.8485947 -48.03644472 -11.660745 0.0000075
## M248_C_RO-F1_S_RO        29.3588712  13.60773112  45.110011 0.0000002
## M248_C_SH-F1_S_RO         2.3299197 -13.42122042  18.081060 1.0000000
## M248_S_RO-F1_S_RO        -1.6521874 -17.83494555  14.530571 1.0000000
## M248_S_SH-F1_S_RO       -29.0084854 -45.19124348 -12.825727 0.0000006
## LA1511_C_RO-F1_S_SH      55.6933071  40.30431059  71.082304 0.0000000
## LA1511_C_SH-F1_S_SH      30.9689368  15.21779666  46.720077 0.0000000
## LA1511_S_RO-F1_S_SH      16.1272651  -0.05549299  32.310023 0.0517926
## LA1511_S_SH-F1_S_SH      -1.6253625 -17.37650266  14.125778 1.0000000
## M058_C_RO-F1_S_SH        56.4466920  40.69555183  72.197832 0.0000000
## M058_C_SH-F1_S_SH        45.4149066  29.66376645  61.166047 0.0000000
## M058_S_RO-F1_S_SH        18.5366652  -0.75446286  37.827793 0.0739620
## M058_S_SH-F1_S_SH        -7.9049912 -26.09284123  10.282859 0.9784124
## M248_C_RO-F1_S_SH        51.3024747  35.55133460  67.053615 0.0000000
## M248_C_SH-F1_S_SH        24.2735232   8.52238307  40.024663 0.0000371
## M248_S_RO-F1_S_SH        20.2914161   4.10865794  36.474174 0.0024362
## M248_S_SH-F1_S_SH        -7.0648819 -23.24763999   9.117876 0.9775211
## LA1511_C_SH-LA1511_C_RO -24.7243703 -40.11336689  -9.335374 0.0000131
## LA1511_S_RO-LA1511_C_RO -39.5660420 -55.39653345 -23.735551 0.0000000
## LA1511_S_SH-LA1511_C_RO -57.3186697 -72.70766621 -41.929673 0.0000000
## M058_C_RO-LA1511_C_RO     0.7533848 -14.63561172  16.142381 1.0000000
## M058_C_SH-LA1511_C_RO   -10.2784006 -25.66739710   5.110596 0.5999429
## M058_S_RO-LA1511_C_RO   -37.1566419 -56.15323166 -18.160052 0.0000000
## M058_S_SH-LA1511_C_RO   -63.5982984 -81.47343995 -45.723157 0.0000000
## M248_C_RO-LA1511_C_RO    -4.3908324 -19.77982894  10.998164 0.9997695
## M248_C_SH-LA1511_C_RO   -31.4197839 -46.80878048 -16.030787 0.0000000
## M248_S_RO-LA1511_C_RO   -35.4018911 -51.23238253 -19.571400 0.0000000
## M248_S_SH-LA1511_C_RO   -62.7581890 -78.58868046 -46.927698 0.0000000
## LA1511_S_RO-LA1511_C_SH -14.8416716 -31.02442977   1.341086 0.1114979
## LA1511_S_SH-LA1511_C_SH -32.5942993 -48.34543944 -16.843159 0.0000000
## M058_C_RO-LA1511_C_SH    25.4777552   9.72661505  41.228895 0.0000110
## M058_C_SH-LA1511_C_SH    14.4459698  -1.30517033  30.197110 0.1114885
## M058_S_RO-LA1511_C_SH   -12.4322716 -31.72339965   6.858857 0.6592209
## M058_S_SH-LA1511_C_SH   -38.8739280 -57.06177801 -20.686078 0.0000000
## M248_C_RO-LA1511_C_SH    20.3335379   4.58239782  36.084678 0.0014778
## M248_C_SH-LA1511_C_SH    -6.6954136 -22.44655372   9.055727 0.9824125
## M248_S_RO-LA1511_C_SH   -10.6775207 -26.86027884   5.505237 0.6205885
## M248_S_SH-LA1511_C_SH   -38.0338186 -54.21657677 -21.851061 0.0000000
## LA1511_S_SH-LA1511_S_RO -17.7526277 -33.93538579  -1.569870 0.0172711
## M058_C_RO-LA1511_S_RO    40.3194268  24.13666869  56.502185 0.0000000
## M058_C_SH-LA1511_S_RO    29.2876414  13.10488331  45.470400 0.0000004
## M058_S_RO-LA1511_S_RO     2.4094001 -17.23572318  22.054523 1.0000000
## M058_S_SH-LA1511_S_RO   -24.0322564 -42.59515304  -5.469360 0.0014045
## M248_C_RO-LA1511_S_RO    35.1752096  18.99245147  51.357968 0.0000000
## M248_C_SH-LA1511_S_RO     8.1462581  -8.03650007  24.329016 0.9260624
## M248_S_RO-LA1511_S_RO     4.1641509 -12.43900858  20.767310 0.9999538
## M248_S_SH-LA1511_S_RO   -23.1921470 -39.79530652  -6.588987 0.0003302
## M058_C_RO-LA1511_S_SH    58.0720545  42.32091436  73.823195 0.0000000
## M058_C_SH-LA1511_S_SH    47.0402691  31.28912898  62.791409 0.0000000
## M058_S_RO-LA1511_S_SH    20.1620278   0.87089967  39.453156 0.0309670
## M058_S_SH-LA1511_S_SH    -6.2796287 -24.46747870  11.908221 0.9978915
## M248_C_RO-LA1511_S_SH    52.9278373  37.17669714  68.678977 0.0000000
## M248_C_SH-LA1511_S_SH    25.8988857  10.14774560  41.650026 0.0000071
## M248_S_RO-LA1511_S_SH    21.9167786   5.73402047  38.099537 0.0006097
## M248_S_SH-LA1511_S_SH    -5.4395193 -21.62227746  10.743239 0.9984340
## M058_C_SH-M058_C_RO     -11.0317854 -26.78292551   4.719355 0.5166394
## M058_S_RO-M058_C_RO     -37.9100267 -57.20115482 -18.618899 0.0000000
## M058_S_SH-M058_C_RO     -64.3516832 -82.53953318 -46.163833 0.0000000
## M248_C_RO-M058_C_RO      -5.1442172 -20.89535735  10.606923 0.9988682
## M248_C_SH-M058_C_RO     -32.1731688 -47.92430889 -16.422029 0.0000000
## M248_S_RO-M058_C_RO     -36.1552759 -52.33803401 -19.972518 0.0000000
## M248_S_SH-M058_C_RO     -63.5115738 -79.69433194 -47.328816 0.0000000
## M058_S_RO-M058_C_SH     -26.8782414 -46.16936944  -7.587113 0.0003478
## M058_S_SH-M058_C_SH     -53.3198978 -71.50774780 -35.132048 0.0000000
## M248_C_RO-M058_C_SH       5.8875682  -9.86357197  21.638708 0.9950649
## M248_C_SH-M058_C_SH     -21.1413834 -36.89252351  -5.390243 0.0007241
## M248_S_RO-M058_C_SH     -25.1234905 -41.30624863  -8.940732 0.0000310
## M248_S_SH-M058_C_SH     -52.4797884 -68.66254656 -36.297030 0.0000000
## M058_S_SH-M058_S_RO     -26.4416565 -47.76880102  -5.114512 0.0029357
## M248_C_RO-M058_S_RO      32.7658095  13.47468142  52.056938 0.0000029
## M248_C_SH-M058_S_RO       5.7368580 -13.55427012  25.027986 0.9996204
## M248_S_RO-M058_S_RO       1.7547508 -17.89037242  21.399874 1.0000000
## M248_S_SH-M058_S_RO     -25.6015471 -45.24667035  -5.956424 0.0012486
## M248_C_RO-M058_S_SH      59.2074660  41.01961599  77.395316 0.0000000
## M248_C_SH-M058_S_SH      32.1785144  13.99066446  50.366364 0.0000009
## M248_S_RO-M058_S_SH      28.1964073   9.63351066  46.759304 0.0000524
## M248_S_SH-M058_S_SH       0.8401094 -17.72278727  19.403006 1.0000000
## M248_C_SH-M248_C_RO     -27.0289515 -42.78009166 -11.277811 0.0000022
## M248_S_RO-M248_C_RO     -31.0110587 -47.19381679 -14.828301 0.0000001
## M248_S_SH-M248_C_RO     -58.3673566 -74.55011472 -42.184598 0.0000000
## M248_S_RO-M248_C_SH      -3.9821071 -20.16486525  12.200651 0.9999638
## M248_S_SH-M248_C_SH     -31.3384051 -47.52116318 -15.155647 0.0000000
## M248_S_SH-M248_S_RO     -27.3562979 -43.95945744 -10.753138 0.0000067
P7 = Output$All.ID[,'p adj']
stat.test<- multcompLetters(P7)
stat.test
##     F1_C_SH     F1_S_RO     F1_S_SH LA1511_C_RO LA1511_C_SH LA1511_S_RO 
##         "a"         "b"        "cd"         "a"        "be"        "bc" 
## LA1511_S_SH   M058_C_RO   M058_C_SH   M058_S_RO   M058_S_SH   M248_C_RO 
##         "d"         "a"        "ae"        "bc"         "d"         "a" 
##   M248_C_SH   M248_S_RO   M248_S_SH     F1_C_RO 
##         "b"         "b"         "d"         "a"
test <- as.data.frame(stat.test$Letters)
test$group1 <- rownames(test)
test$group2 <- rownames(test)
colnames(test)[1] <- "Tukey"
test
###################################################################
test$info <- strsplit(test$group1, "_")
test$info[[1]][2]
## [1] "C"
test$info[[1]][3]
## [1] "SH"
test$Accession <- "none"
test$Condition <- "none"
test$Tissue<- "none"
test
for(i in 1:nrow(test)){
  test$Accession[i] <- test$info[[i]][1]
  test$Condition[i] <- test$info[[i]][2]
  test$Tissue[i] <- test$info[[i]][3]
  
}

test2 <- test[,c(5:7,1)]
test2$group1 <- test2$Accession
test2$group2 <- test2$Accession

ICP_F1
K_content_F1 <- ggplot(data = ICP_F1, mapping = aes(x = All.ID, y = K.con..mg.mg.dry.weight, colour = Condition)) 
K_content_F1  <- K_content_F1  + geom_boxplot(alpha=0.2) + geom_jitter(width=0.1,alpha=0.2)
K_content_F1  <- K_content_F1  + stat_summary(fun=mean, geom="point", shape=95, size=6, color="black", fill="black")
K_content_F1  <- K_content_F1  + scale_color_manual(values = c("blue","red"))
K_content_F1  <- K_content_F1  + ylab("K content, mg/mg dry weight") + xlab("")
K_content_F1  <- K_content_F1  + theme(axis.text.x = element_text(angle=90, hjust=0.9, vjust=0.5))
K_content_F1  <- K_content_F1  + stat_pvalue_manual(test, label = "Tukey", y.position = 120) + rremove("legend")
K_content_F1 

pdf("K.accumulation.F1.ICPMS.pdf", height = 5, width = 10)
plot(K_content_F1)
dev.off()
## png 
##   2
K_content_F1 <- ggplot(data = ICP_F1, mapping = aes(x = Accession, y = K.con..mg.mg.dry.weight, colour = Accession)) 
K_content_F1 <- K_content_F1 + geom_boxplot(alpha=0.2) + geom_jitter(width=0.1,alpha=0.2)

K_content_F1 <- K_content_F1 + facet_grid(Tissue ~ Condition)

K_content_F1 <- K_content_F1 + stat_summary(fun=mean, geom="point", shape=95, size=6, color="black", fill="black")
K_content_F1 <- K_content_F1 + scale_color_manual(values = c("royalblue", "coral3", "deeppink", "green"))
K_content_F1 <- K_content_F1 + ylab("K content, mg/mg dry weight") + xlab("")+ stat_pvalue_manual(test2, label = "Tukey", y.position = 90)
K_content_F1 <- K_content_F1 + theme(axis.text.x = element_text(angle=90, hjust=0.9, vjust=0.5))
K_content_F1 <- K_content_F1 + rremove("legend")
K_content_F1

aov(Na.k.ratio ~ All.ID, data = ICP_F1)
## Call:
##    aov(formula = Na.k.ratio ~ All.ID, data = ICP_F1)
## 
## Terms:
##                   All.ID Residuals
## Sum of Squares  391.8797   17.0037
## Deg. of Freedom       15       131
## 
## Residual standard error: 0.3602763
## Estimated effects may be unbalanced
Output <- TukeyHSD(aov(Na.k.ratio ~ All.ID, data = ICP_F1))
Output
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = Na.k.ratio ~ All.ID, data = ICP_F1)
## 
## $All.ID
##                                  diff        lwr        upr     p adj
## F1_C_SH-F1_C_RO          0.0121485786 -0.5812264  0.6055235 1.0000000
## F1_S_RO-F1_C_RO          0.9343020907  0.3559517  1.5126524 0.0000113
## F1_S_SH-F1_C_RO          2.9671324075  2.3887821  3.5454828 0.0000000
## LA1511_C_RO-F1_C_RO      0.0687970332 -0.4969638  0.6345578 1.0000000
## LA1511_C_SH-F1_C_RO      0.0202636840 -0.5580867  0.5986140 1.0000000
## LA1511_S_RO-F1_C_RO      0.9692363427  0.3758614  1.5626113 0.0000085
## LA1511_S_SH-F1_C_RO      2.5352680507  1.9569177  3.1136184 0.0000000
## M058_C_RO-F1_C_RO       -0.0052055459 -0.5835559  0.5731448 1.0000000
## M058_C_SH-F1_C_RO        0.0155380668 -0.5628123  0.5938884 1.0000000
## M058_S_RO-F1_C_RO        1.4147549529  0.7126643  2.1168456 0.0000000
## M058_S_SH-F1_C_RO        4.5415989953  3.8781856  5.2050123 0.0000000
## M248_C_RO-F1_C_RO       -0.0002742748 -0.5786246  0.5780761 1.0000000
## M248_C_SH-F1_C_RO        0.0425693503 -0.5357810  0.6209197 1.0000000
## M248_S_RO-F1_C_RO        1.2130690177  0.6196941  1.8064440 0.0000000
## M248_S_SH-F1_C_RO        5.4784583689  4.8850834  6.0718333 0.0000000
## F1_S_RO-F1_C_SH          0.9221535122  0.3438032  1.5005039 0.0000159
## F1_S_SH-F1_C_SH          2.9549838290  2.3766335  3.5333342 0.0000000
## LA1511_C_RO-F1_C_SH      0.0566484547 -0.5091123  0.6224093 1.0000000
## LA1511_C_SH-F1_C_SH      0.0081151055 -0.5702352  0.5864655 1.0000000
## LA1511_S_RO-F1_C_SH      0.9570877641  0.3637128  1.5504627 0.0000118
## LA1511_S_SH-F1_C_SH      2.5231194722  1.9447691  3.1014698 0.0000000
## M058_C_RO-F1_C_SH       -0.0173541244 -0.5957045  0.5609962 1.0000000
## M058_C_SH-F1_C_SH        0.0033894883 -0.5749609  0.5817398 1.0000000
## M058_S_RO-F1_C_SH        1.4026063744  0.7005157  2.1046971 0.0000000
## M058_S_SH-F1_C_SH        4.5294504168  3.8660371  5.1928638 0.0000000
## M248_C_RO-F1_C_SH       -0.0124228533 -0.5907732  0.5659275 1.0000000
## M248_C_SH-F1_C_SH        0.0304207718 -0.5479296  0.6087711 1.0000000
## M248_S_RO-F1_C_SH        1.2009204391  0.6075455  1.7942954 0.0000000
## M248_S_SH-F1_C_SH        5.4663097903  4.8729349  6.0596847 0.0000000
## F1_S_SH-F1_S_RO          2.0328303168  1.4699054  2.5957552 0.0000000
## LA1511_C_RO-F1_S_RO     -0.8655050575 -1.4154874 -0.3155227 0.0000222
## LA1511_C_SH-F1_S_RO     -0.9140384067 -1.4769633 -0.3511135 0.0000099
## LA1511_S_RO-F1_S_RO      0.0349342519 -0.5434161  0.6132846 1.0000000
## LA1511_S_SH-F1_S_RO      1.6009659600  1.0380411  2.1638909 0.0000000
## M058_C_RO-F1_S_RO       -0.9395076366 -1.5024325 -0.3765827 0.0000047
## M058_C_SH-F1_S_RO       -0.9187640239 -1.4816889 -0.3558391 0.0000087
## M058_S_RO-F1_S_RO        0.4804528622 -0.2089865  1.1698922 0.5256021
## M058_S_SH-F1_S_RO        3.6072969046  2.9572872  4.2573066 0.0000000
## M248_C_RO-F1_S_RO       -0.9345763655 -1.4975013 -0.3716515 0.0000055
## M248_C_SH-F1_S_RO       -0.8917327404 -1.4546576 -0.3288078 0.0000188
## M248_S_RO-F1_S_RO        0.2787669269 -0.2995834  0.8571173 0.9474118
## M248_S_SH-F1_S_RO        4.5441562782  3.9658059  5.1225066 0.0000000
## LA1511_C_RO-F1_S_SH     -2.8983353743 -3.4483177 -2.3483530 0.0000000
## LA1511_C_SH-F1_S_SH     -2.9468687235 -3.5097936 -2.3839438 0.0000000
## LA1511_S_RO-F1_S_SH     -1.9978960649 -2.5762464 -1.4195457 0.0000000
## LA1511_S_SH-F1_S_SH     -0.4318643568 -0.9947892  0.1310605 0.3546476
## M058_C_RO-F1_S_SH       -2.9723379534 -3.5352628 -2.4094131 0.0000000
## M058_C_SH-F1_S_SH       -2.9515943407 -3.5145192 -2.3886694 0.0000000
## M058_S_RO-F1_S_SH       -1.5523774546 -2.2418168 -0.8629381 0.0000000
## M058_S_SH-F1_S_SH        1.5744665878  0.9244569  2.2244763 0.0000000
## M248_C_RO-F1_S_SH       -2.9674066823 -3.5303316 -2.4044818 0.0000000
## M248_C_SH-F1_S_SH       -2.9245630572 -3.4874879 -2.3616382 0.0000000
## M248_S_RO-F1_S_SH       -1.7540633899 -2.3324137 -1.1757130 0.0000000
## M248_S_SH-F1_S_SH        2.5113259614  1.9329756  3.0896763 0.0000000
## LA1511_C_SH-LA1511_C_RO -0.0485333492 -0.5985157  0.5014490 1.0000000
## LA1511_S_RO-LA1511_C_RO  0.9004393094  0.3346785  1.4662001 0.0000167
## LA1511_S_SH-LA1511_C_RO  2.4664710175  1.9164887  3.0164534 0.0000000
## M058_C_RO-LA1511_C_RO   -0.0740025791 -0.6239849  0.4759798 1.0000000
## M058_C_SH-LA1511_C_RO   -0.0532589664 -0.6032413  0.4967234 1.0000000
## M058_S_RO-LA1511_C_RO    1.3459579197  0.6670450  2.0248709 0.0000000
## M058_S_SH-LA1511_C_RO    4.4728019621  3.8339681  5.1116359 0.0000000
## M248_C_RO-LA1511_C_RO   -0.0690713080 -0.6190537  0.4809111 1.0000000
## M248_C_SH-LA1511_C_RO   -0.0262276829 -0.5762100  0.5237547 1.0000000
## M248_S_RO-LA1511_C_RO    1.1442719844  0.5785112  1.7100328 0.0000000
## M248_S_SH-LA1511_C_RO    5.4096613356  4.8439005  5.9754221 0.0000000
## LA1511_S_RO-LA1511_C_SH  0.9489726586  0.3706223  1.5273230 0.0000075
## LA1511_S_SH-LA1511_C_SH  2.5150043667  1.9520795  3.0779293 0.0000000
## M058_C_RO-LA1511_C_SH   -0.0254692299 -0.5883941  0.5374557 1.0000000
## M058_C_SH-LA1511_C_SH   -0.0047256172 -0.5676505  0.5581993 1.0000000
## M058_S_RO-LA1511_C_SH    1.3944912689  0.7050519  2.0839306 0.0000000
## M058_S_SH-LA1511_C_SH    4.5213353113  3.8713256  5.1713450 0.0000000
## M248_C_RO-LA1511_C_SH   -0.0205379588 -0.5834629  0.5423869 1.0000000
## M248_C_SH-LA1511_C_SH    0.0223056663 -0.5406192  0.5852306 1.0000000
## M248_S_RO-LA1511_C_SH    1.1928053336  0.6144550  1.7711557 0.0000000
## M248_S_SH-LA1511_C_SH    5.4581946849  4.8798443  6.0365450 0.0000000
## LA1511_S_SH-LA1511_S_RO  1.5660317081  0.9876814  2.1443821 0.0000000
## M058_C_RO-LA1511_S_RO   -0.9744418885 -1.5527922 -0.3960915 0.0000036
## M058_C_SH-LA1511_S_RO   -0.9536982758 -1.5320486 -0.3753479 0.0000066
## M058_S_RO-LA1511_S_RO    0.4455186103 -0.2565721  1.1476093 0.6836090
## M058_S_SH-LA1511_S_RO    3.5723626527  2.9089493  4.2357760 0.0000000
## M248_C_RO-LA1511_S_RO   -0.9695106174 -1.5478610 -0.3911603 0.0000042
## M248_C_SH-LA1511_S_RO   -0.9266669923 -1.5050173 -0.3483166 0.0000140
## M248_S_RO-LA1511_S_RO    0.2438326750 -0.3495423  0.8372076 0.9872388
## M248_S_SH-LA1511_S_RO    4.5092220262  3.9158471  5.1025970 0.0000000
## M058_C_RO-LA1511_S_SH   -2.5404735966 -3.1033985 -1.9775487 0.0000000
## M058_C_SH-LA1511_S_SH   -2.5197299839 -3.0826549 -1.9568051 0.0000000
## M058_S_RO-LA1511_S_SH   -1.1205130978 -1.8099525 -0.4310737 0.0000097
## M058_S_SH-LA1511_S_SH    2.0063309446  1.3563213  2.6563406 0.0000000
## M248_C_RO-LA1511_S_SH   -2.5355423255 -3.0984672 -1.9726174 0.0000000
## M248_C_SH-LA1511_S_SH   -2.4926987004 -3.0556236 -1.9297738 0.0000000
## M248_S_RO-LA1511_S_SH   -1.3221990331 -1.9005494 -0.7438487 0.0000000
## M248_S_SH-LA1511_S_SH    2.9431903182  2.3648400  3.5215407 0.0000000
## M058_C_SH-M058_C_RO      0.0207436127 -0.5421813  0.5836685 1.0000000
## M058_S_RO-M058_C_RO      1.4199604988  0.7305211  2.1093999 0.0000000
## M058_S_SH-M058_C_RO      4.5468045412  3.8967949  5.1968142 0.0000000
## M248_C_RO-M058_C_RO      0.0049312711 -0.5579936  0.5678562 1.0000000
## M248_C_SH-M058_C_RO      0.0477748962 -0.5151500  0.6106998 1.0000000
## M248_S_RO-M058_C_RO      1.2182745635  0.6399242  1.7966249 0.0000000
## M248_S_SH-M058_C_RO      5.4836639148  4.9053136  6.0620143 0.0000000
## M058_S_RO-M058_C_SH      1.3992168861  0.7097775  2.0886563 0.0000000
## M058_S_SH-M058_C_SH      4.5260609285  3.8760513  5.1760706 0.0000000
## M248_C_RO-M058_C_SH     -0.0158123416 -0.5787372  0.5471126 1.0000000
## M248_C_SH-M058_C_SH      0.0270312835 -0.5358936  0.5899562 1.0000000
## M248_S_RO-M058_C_SH      1.1975309508  0.6191806  1.7758813 0.0000000
## M248_S_SH-M058_C_SH      5.4629203021  4.8845700  6.0412706 0.0000000
## M058_S_SH-M058_S_RO      3.1268440424  2.3646401  3.8890479 0.0000000
## M248_C_RO-M058_S_RO     -1.4150292277 -2.1044686 -0.7255899 0.0000000
## M248_C_SH-M058_S_RO     -1.3721856026 -2.0616250 -0.6827462 0.0000000
## M248_S_RO-M058_S_RO     -0.2016859353 -0.9037766  0.5004048 0.9997497
## M248_S_SH-M058_S_RO      4.0637034160  3.3616127  4.7657941 0.0000000
## M248_C_RO-M058_S_SH     -4.5418732701 -5.1918829 -3.8918636 0.0000000
## M248_C_SH-M058_S_SH     -4.4990296450 -5.1490393 -3.8490200 0.0000000
## M248_S_RO-M058_S_SH     -3.3285299777 -3.9919433 -2.6651166 0.0000000
## M248_S_SH-M058_S_SH      0.9368593736  0.2734460  1.6002727 0.0002637
## M248_C_SH-M248_C_RO      0.0428436251 -0.5200813  0.6057685 1.0000000
## M248_S_RO-M248_C_RO      1.2133432924  0.6349929  1.7916936 0.0000000
## M248_S_SH-M248_C_RO      5.4787326437  4.9003823  6.0570830 0.0000000
## M248_S_RO-M248_C_SH      1.1704996673  0.5921493  1.7488500 0.0000000
## M248_S_SH-M248_C_SH      5.4358890186  4.8575387  6.0142394 0.0000000
## M248_S_SH-M248_S_RO      4.2653893512  3.6720144  4.8587643 0.0000000
P8 = Output$All.ID[,'p adj']
stat.test<- multcompLetters(P8)
stat.test
##     F1_C_SH     F1_S_RO     F1_S_SH LA1511_C_RO LA1511_C_SH LA1511_S_RO 
##         "a"         "b"         "c"         "a"         "a"         "b" 
## LA1511_S_SH   M058_C_RO   M058_C_SH   M058_S_RO   M058_S_SH   M248_C_RO 
##         "c"         "a"         "a"         "b"         "d"         "a" 
##   M248_C_SH   M248_S_RO   M248_S_SH     F1_C_RO 
##         "a"         "b"         "e"         "a"
test <- as.data.frame(stat.test$Letters)
test$group1 <- rownames(test)
test$group2 <- rownames(test)
colnames(test)[1] <- "Tukey"
test
###################################################################
test$info <- strsplit(test$group1, "_")
test$info[[1]][2]
## [1] "C"
test$info[[1]][3]
## [1] "SH"
test$Accession <- "none"
test$Condition <- "none"
test$Tissue<- "none"
test
for(i in 1:nrow(test)){
  test$Accession[i] <- test$info[[i]][1]
  test$Condition[i] <- test$info[[i]][2]
  test$Tissue[i] <- test$info[[i]][3]
  
}

test2 <- test[,c(5:7,1)]
test2$group1 <- test2$Accession
test2$group2 <- test2$Accession

ICP_F1
NaK_ratio_F1 <- ggplot(data = ICP_F1, mapping = aes(x = All.ID, y = Na.k.ratio, colour = Condition)) 
NaK_ratio_F1  <- NaK_ratio_F1  + geom_boxplot(alpha=0.2) + geom_jitter(width=0.1,alpha=0.2)
NaK_ratio_F1  <- NaK_ratio_F1  + stat_summary(fun=mean, geom="point", shape=95, size=6, color="black", fill="black")
NaK_ratio_F1  <- NaK_ratio_F1  + scale_color_manual(values = c("blue","red"))
NaK_ratio_F1  <- NaK_ratio_F1  + ylab("Na/K ratio, mg/mg dry weight") + xlab("")
NaK_ratio_F1  <- NaK_ratio_F1  + theme(axis.text.x = element_text(angle=90, hjust=0.9, vjust=0.5))
NaK_ratio_F1  <- NaK_ratio_F1  + stat_pvalue_manual(test, label = "Tukey", y.position = 120) + rremove("legend")
NaK_ratio_F1 

pdf("Na-K.ratio.F1.ICPMS.pdf", height = 5, width = 10)
plot(NaK_ratio_F1)
dev.off()
## png 
##   2
ICP_F1_subset <- subset(ICP_F1, ICP_F1$Na.k.ratio < 10)

NaK_ratio_F1 <- ggplot(data = ICP_F1_subset, mapping = aes(x = Accession, y = Na.k.ratio, colour = Accession)) 
NaK_ratio_F1 <- NaK_ratio_F1 + geom_boxplot(alpha=0.2) + geom_jitter(width=0.1,alpha=0.2)
#To assign free scale for shoot and root, use the following code in faceting
NaK_ratio_F1 <- NaK_ratio_F1 + facet_grid(Tissue ~ Condition, scales = "free_y")

NaK_ratio_F1 <- NaK_ratio_F1 + stat_summary(fun=mean, geom="point", shape=95, size=6, color="black", fill="black")
NaK_ratio_F1 <- NaK_ratio_F1 + scale_color_manual(values = c("royalblue", "coral3", "deeppink", "green"))


NaK_ratio_F1 <- NaK_ratio_F1 + ylab("Na+/K+ ratio") + xlab("")+ stat_pvalue_manual(test2, label = "Tukey", y.position = 5)
NaK_ratio_F1 <- NaK_ratio_F1 + theme(axis.text.x = element_text(angle=90, hjust=0.9, vjust=0.5))
NaK_ratio_F1 <- NaK_ratio_F1 + rremove("legend")
#my_box_plot2 <- my_box_plot2 + stat_pvalue_manual(test, label = "Tukey", y.position = 80)
NaK_ratio_F1 

library(cowplot)
## 
## Attaching package: 'cowplot'
## The following object is masked from 'package:ggpubr':
## 
##     get_legend
pdf("ICP-F1-all.pdf", height = 5, width = 12)
plot_grid(Na_content_F1, K_content_F1,NaK_ratio_F1, ncol=3,
          align = "hv", labels=c("AUTO"), 
          label_size = 24)
dev.off()
## png 
##   2
aov(DW.mg ~ All.ID, data = ICP_F1)
## Call:
##    aov(formula = DW.mg ~ All.ID, data = ICP_F1)
## 
## Terms:
##                    All.ID Residuals
## Sum of Squares  10448.483  1003.937
## Deg. of Freedom        15       131
## 
## Residual standard error: 2.768329
## Estimated effects may be unbalanced
Output <- TukeyHSD(aov(DW.mg ~ All.ID, data = ICP_F1))
Output
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = DW.mg ~ All.ID, data = ICP_F1)
## 
## $All.ID
##                                  diff         lwr          upr     p adj
## F1_C_SH-F1_C_RO          2.515556e+01  20.5961184  29.71499276 0.0000000
## F1_S_RO-F1_C_RO          1.165556e+00  -3.2784341   5.60954523 0.9999186
## F1_S_SH-F1_C_RO          1.838556e+01  13.9415659  22.82954523 0.0000000
## LA1511_C_RO-F1_C_RO     -8.808081e-01  -5.2280609   3.46644472 0.9999972
## LA1511_C_SH-F1_C_RO      1.349556e+01   9.0515659  17.93954523 0.0000000
## LA1511_S_RO-F1_C_RO     -1.344444e+00  -5.9038816   3.21499276 0.9996570
## LA1511_S_SH-F1_C_RO      5.215556e+00   0.7715659   9.65954523 0.0068654
## M058_C_RO-F1_C_RO       -1.854444e+00  -6.2984341   2.58954523 0.9852183
## M058_C_SH-F1_C_RO        8.685556e+00   4.2415659  13.12954523 0.0000000
## M058_S_RO-F1_C_RO       -2.784444e+00  -8.1792433   2.61035441 0.9108684
## M058_S_SH-F1_C_RO        4.138889e+00  -0.9587169   9.23649465 0.2622070
## M248_C_RO-F1_C_RO        8.355556e-01  -3.6084341   5.27954523 0.9999990
## M248_C_SH-F1_C_RO        1.838556e+01  13.9415659  22.82954523 0.0000000
## M248_S_RO-F1_C_RO       -1.966667e+00  -6.5261039   2.59277054 0.9798625
## M248_S_SH-F1_C_RO        7.366667e+00   2.8072295  11.92610387 0.0000113
## F1_S_RO-F1_C_SH         -2.399000e+01 -28.4339897 -19.54601033 0.0000000
## F1_S_SH-F1_C_SH         -6.770000e+00 -11.2139897  -2.32601033 0.0000489
## LA1511_C_RO-F1_C_SH     -2.603636e+01 -30.3836164 -21.68911084 0.0000000
## LA1511_C_SH-F1_C_SH     -1.166000e+01 -16.1039897  -7.21601033 0.0000000
## LA1511_S_RO-F1_C_SH     -2.650000e+01 -31.0594372 -21.94056280 0.0000000
## LA1511_S_SH-F1_C_SH     -1.994000e+01 -24.3839897 -15.49601033 0.0000000
## M058_C_RO-F1_C_SH       -2.701000e+01 -31.4539897 -22.56601033 0.0000000
## M058_C_SH-F1_C_SH       -1.647000e+01 -20.9139897 -12.02601033 0.0000000
## M058_S_RO-F1_C_SH       -2.794000e+01 -33.3347989 -22.54520115 0.0000000
## M058_S_SH-F1_C_SH       -2.101667e+01 -26.1142724 -15.91906091 0.0000000
## M248_C_RO-F1_C_SH       -2.432000e+01 -28.7639897 -19.87601033 0.0000000
## M248_C_SH-F1_C_SH       -6.770000e+00 -11.2139897  -2.32601033 0.0000489
## M248_S_RO-F1_C_SH       -2.712222e+01 -31.6816594 -22.56278502 0.0000000
## M248_S_SH-F1_C_SH       -1.778889e+01 -22.3483261 -13.22945169 0.0000000
## F1_S_SH-F1_S_RO          1.722000e+01  12.8945381  21.54546192 0.0000000
## LA1511_C_RO-F1_S_RO     -2.046364e+00  -6.2723764   2.17964909 0.9454225
## LA1511_C_SH-F1_S_RO      1.233000e+01   8.0045381  16.65546192 0.0000000
## LA1511_S_RO-F1_S_RO     -2.510000e+00  -6.9539897   1.93398967 0.8351644
## LA1511_S_SH-F1_S_RO      4.050000e+00  -0.2754619   8.37546192 0.0934809
## M058_C_RO-F1_S_RO       -3.020000e+00  -7.3454619   1.30546192 0.5222334
## M058_C_SH-F1_S_RO        7.520000e+00   3.1945381  11.84546192 0.0000015
## M058_S_RO-F1_S_RO       -3.950000e+00  -9.2475873   1.34758731 0.4044364
## M058_S_SH-F1_S_RO        2.973333e+00  -2.0212799   7.96794654 0.7741841
## M248_C_RO-F1_S_RO       -3.300000e-01  -4.6554619   3.99546192 1.0000000
## M248_C_SH-F1_S_RO        1.722000e+01  12.8945381  21.54546192 0.0000000
## M248_S_RO-F1_S_RO       -3.132222e+00  -7.5762119   1.31176745 0.5053149
## M248_S_SH-F1_S_RO        6.201111e+00   1.7571214  10.64510078 0.0003373
## LA1511_C_RO-F1_S_SH     -1.926636e+01 -23.4923764 -15.04035091 0.0000000
## LA1511_C_SH-F1_S_SH     -4.890000e+00  -9.2154619  -0.56453808 0.0116348
## LA1511_S_RO-F1_S_SH     -1.973000e+01 -24.1739897 -15.28601033 0.0000000
## LA1511_S_SH-F1_S_SH     -1.317000e+01 -17.4954619  -8.84453808 0.0000000
## M058_C_RO-F1_S_SH       -2.024000e+01 -24.5654619 -15.91453808 0.0000000
## M058_C_SH-F1_S_SH       -9.700000e+00 -14.0254619  -5.37453808 0.0000000
## M058_S_RO-F1_S_SH       -2.117000e+01 -26.4675873 -15.87241269 0.0000000
## M058_S_SH-F1_S_SH       -1.424667e+01 -19.2412799  -9.25205346 0.0000000
## M248_C_RO-F1_S_SH       -1.755000e+01 -21.8754619 -13.22453808 0.0000000
## M248_C_SH-F1_S_SH        1.776357e-14  -4.3254619   4.32546192 1.0000000
## M248_S_RO-F1_S_SH       -2.035222e+01 -24.7962119 -15.90823255 0.0000000
## M248_S_SH-F1_S_SH       -1.101889e+01 -15.4628786  -6.57489922 0.0000000
## LA1511_C_SH-LA1511_C_RO  1.437636e+01  10.1503509  18.60237636 0.0000000
## LA1511_S_RO-LA1511_C_RO -4.636364e-01  -4.8108892   3.88361644 1.0000000
## LA1511_S_SH-LA1511_C_RO  6.096364e+00   1.8703509  10.32237636 0.0001679
## M058_C_RO-LA1511_C_RO   -9.736364e-01  -5.1996491   3.25237636 0.9999846
## M058_C_SH-LA1511_C_RO    9.566364e+00   5.3403509  13.79237636 0.0000000
## M058_S_RO-LA1511_C_RO   -1.903636e+00  -7.1203397   3.31306700 0.9961662
## M058_S_SH-LA1511_C_RO    5.019697e+00   0.1109574   9.92843650 0.0394747
## M248_C_RO-LA1511_C_RO    1.716364e+00  -2.5096491   5.94237636 0.9886058
## M248_C_SH-LA1511_C_RO    1.926636e+01  15.0403509  23.49237636 0.0000000
## M248_S_RO-LA1511_C_RO   -1.085859e+00  -5.4331114   3.26139421 0.9999562
## M248_S_SH-LA1511_C_RO    8.247475e+00   3.9002219  12.59472755 0.0000001
## LA1511_S_RO-LA1511_C_SH -1.484000e+01 -19.2839897 -10.39601033 0.0000000
## LA1511_S_SH-LA1511_C_SH -8.280000e+00 -12.6054619  -3.95453808 0.0000001
## M058_C_RO-LA1511_C_SH   -1.535000e+01 -19.6754619 -11.02453808 0.0000000
## M058_C_SH-LA1511_C_SH   -4.810000e+00  -9.1354619  -0.48453808 0.0144939
## M058_S_RO-LA1511_C_SH   -1.628000e+01 -21.5775873 -10.98241269 0.0000000
## M058_S_SH-LA1511_C_SH   -9.356667e+00 -14.3512799  -4.36205346 0.0000001
## M248_C_RO-LA1511_C_SH   -1.266000e+01 -16.9854619  -8.33453808 0.0000000
## M248_C_SH-LA1511_C_SH    4.890000e+00   0.5645381   9.21546192 0.0116348
## M248_S_RO-LA1511_C_SH   -1.546222e+01 -19.9062119 -11.01823255 0.0000000
## M248_S_SH-LA1511_C_SH   -6.128889e+00 -10.5728786  -1.68489922 0.0004271
## LA1511_S_SH-LA1511_S_RO  6.560000e+00   2.1160103  11.00398967 0.0001012
## M058_C_RO-LA1511_S_RO   -5.100000e-01  -4.9539897   3.93398967 1.0000000
## M058_C_SH-LA1511_S_RO    1.003000e+01   5.5860103  14.47398967 0.0000000
## M058_S_RO-LA1511_S_RO   -1.440000e+00  -6.8347989   3.95479885 0.9998986
## M058_S_SH-LA1511_S_RO    5.483333e+00   0.3857276  10.58093909 0.0220532
## M248_C_RO-LA1511_S_RO    2.180000e+00  -2.2639897   6.62398967 0.9394865
## M248_C_SH-LA1511_S_RO    1.973000e+01  15.2860103  24.17398967 0.0000000
## M248_S_RO-LA1511_S_RO   -6.222222e-01  -5.1816594   3.93721498 1.0000000
## M248_S_SH-LA1511_S_RO    8.711111e+00   4.1516739  13.27054831 0.0000001
## M058_C_RO-LA1511_S_SH   -7.070000e+00 -11.3954619  -2.74453808 0.0000083
## M058_C_SH-LA1511_S_SH    3.470000e+00  -0.8554619   7.79546192 0.2808703
## M058_S_RO-LA1511_S_SH   -8.000000e+00 -13.2975873  -2.70241269 0.0000601
## M058_S_SH-LA1511_S_SH   -1.076667e+00  -6.0712799   3.91794654 0.9999936
## M248_C_RO-LA1511_S_SH   -4.380000e+00  -8.7054619  -0.05453808 0.0438627
## M248_C_SH-LA1511_S_SH    1.317000e+01   8.8445381  17.49546192 0.0000000
## M248_S_RO-LA1511_S_SH   -7.182222e+00 -11.6262119  -2.73823255 0.0000112
## M248_S_SH-LA1511_S_SH    2.151111e+00  -2.2928786   6.59510078 0.9455860
## M058_C_SH-M058_C_RO      1.054000e+01   6.2145381  14.86546192 0.0000000
## M058_S_RO-M058_C_RO     -9.300000e-01  -6.2275873   4.36758731 0.9999996
## M058_S_SH-M058_C_RO      5.993333e+00   0.9987201  10.98794654 0.0049233
## M248_C_RO-M058_C_RO      2.690000e+00  -1.6354619   7.01546192 0.7140304
## M248_C_SH-M058_C_RO      2.024000e+01  15.9145381  24.56546192 0.0000000
## M248_S_RO-M058_C_RO     -1.122222e-01  -4.5562119   4.33176745 1.0000000
## M248_S_SH-M058_C_RO      9.221111e+00   4.7771214  13.66510078 0.0000000
## M058_S_RO-M058_C_SH     -1.147000e+01 -16.7675873  -6.17241269 0.0000000
## M058_S_SH-M058_C_SH     -4.546667e+00  -9.5412799   0.44794654 0.1185304
## M248_C_RO-M058_C_SH     -7.850000e+00 -12.1754619  -3.52453808 0.0000004
## M248_C_SH-M058_C_SH      9.700000e+00   5.3745381  14.02546192 0.0000000
## M248_S_RO-M058_C_SH     -1.065222e+01 -15.0962119  -6.20823255 0.0000000
## M248_S_SH-M058_C_SH     -1.318889e+00  -5.7628786   3.12510078 0.9996295
## M058_S_SH-M058_S_RO      6.923333e+00   1.0666302  12.78003646 0.0061718
## M248_C_RO-M058_S_RO      3.620000e+00  -1.6775873   8.91758731 0.5603642
## M248_C_SH-M058_S_RO      2.117000e+01  15.8724127  26.46758731 0.0000000
## M248_S_RO-M058_S_RO      8.177778e-01  -4.5770211   6.21257663 0.9999999
## M248_S_SH-M058_S_RO      1.015111e+01   4.7563123  15.54590996 0.0000001
## M248_C_RO-M058_S_SH     -3.303333e+00  -8.2979465   1.69127988 0.6165950
## M248_C_SH-M058_S_SH      1.424667e+01   9.2520535  19.24127988 0.0000000
## M248_S_RO-M058_S_SH     -6.105556e+00 -11.2031613  -1.00794979 0.0050653
## M248_S_SH-M058_S_SH      3.227778e+00  -1.8698280   8.32538354 0.6869343
## M248_C_SH-M248_C_RO      1.755000e+01  13.2245381  21.87546192 0.0000000
## M248_S_RO-M248_C_RO     -2.802222e+00  -7.2462119   1.64176745 0.6933125
## M248_S_SH-M248_C_RO      6.531111e+00   2.0871214  10.97510078 0.0001117
## M248_S_RO-M248_C_SH     -2.035222e+01 -24.7962119 -15.90823255 0.0000000
## M248_S_SH-M248_C_SH     -1.101889e+01 -15.4628786  -6.57489922 0.0000000
## M248_S_SH-M248_S_RO      9.333333e+00   4.7738961  13.89277054 0.0000000
P5 = Output$All.ID[,'p adj']
stat.test<- multcompLetters(P5)
stat.test
##     F1_C_SH     F1_S_RO     F1_S_SH LA1511_C_RO LA1511_C_SH LA1511_S_RO 
##         "a"       "bcd"         "e"         "b"         "f"         "b" 
## LA1511_S_SH   M058_C_RO   M058_C_SH   M058_S_RO   M058_S_SH   M248_C_RO 
##        "cg"         "b"         "g"         "b"       "cdg"        "bd" 
##   M248_C_SH   M248_S_RO   M248_S_SH     F1_C_RO 
##         "e"         "b"         "g"        "bd"
test <- as.data.frame(stat.test$Letters)
test$group1 <- rownames(test)
test$group2 <- rownames(test)
colnames(test)[1] <- "Tukey"
test
F1_DW <- ggplot(data = ICP_F1, mapping = aes(x = All.ID, y = DW.mg , colour = Condition)) 
F1_DW  <- F1_DW  + geom_boxplot(alpha=0.2) + geom_jitter(width=0.1,alpha=0.2)
F1_DW  <- F1_DW  + stat_summary(fun=mean, geom="point", shape=95, size=6, color="black", fill="black")
F1_DW  <- F1_DW  + scale_color_manual(values = c("blue","red"))
F1_DW  <- F1_DW  + ylab("Dry weight, mg") + xlab("")
F1_DW  <- F1_DW  + theme(axis.text.x = element_text(angle=90, hjust=0.9, vjust=0.5))
F1_DW  <- F1_DW  + stat_pvalue_manual(test, label = "Tukey", y.position = 120) + rremove("legend")
F1_DW 

pdf("F1.Dry.weight.pdf", height = 5, width = 10)
plot(F1_DW)
dev.off()
## png 
##   2
F1_DW <- ggplot(data = ICP_F1_subset, mapping = aes(x = Condition, y = DW.mg, colour = Condition)) 
F1_DW <- F1_DW + geom_boxplot(alpha=0.2) + geom_jitter(width=0.1,alpha=0.2)
#To assign free scale for shoot and root, use the following code in faceting
F1_DW <- F1_DW + facet_grid(Tissue ~ Accession, scales = "free_y")

F1_DW <- F1_DW + stat_summary(fun=mean, geom="point", shape=95, size=6, color="black", fill="black")
F1_DW <- F1_DW + scale_color_manual(values = c("blue","red"))


F1_DW <- F1_DW + ylab("Dry weight, mg") + xlab("")
F1_DW <- F1_DW + theme(axis.text.x = element_text(angle=90, hjust=0.9, vjust=0.5))
F1_DW <- F1_DW + rremove("legend")
#my_box_plot2 <- my_box_plot2 + stat_pvalue_manual(test, label = "Tukey", y.position = 80)
F1_DW 

Now graph FW….

F1_FW <- read.csv("20230118_FW_RSA_M248M058LA1511_F1_Salt.csv")
F1_FW
F1_FW$All.ID<-paste(F1_FW$Accession,F1_FW$Condition, F1_FW$Tissue, sep="_")
F1_FW
aov(FW.mg ~ All.ID, data = F1_FW)
## Call:
##    aov(formula = FW.mg ~ All.ID, data = F1_FW)
## 
## Terms:
##                  All.ID Residuals
## Sum of Squares  3474551    304293
## Deg. of Freedom      15       130
## 
## Residual standard error: 48.38098
## Estimated effects may be unbalanced
Output <- TukeyHSD(aov(FW.mg ~ All.ID, data = F1_FW))
Output
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = FW.mg ~ All.ID, data = F1_FW)
## 
## $All.ID
##                                 diff          lwr         upr     p adj
## F1_C_SH-F1_C_RO          453.0375000  368.5077513  537.567249 0.0000000
## F1_S_RO-F1_C_RO          -24.1650000 -104.3569608   56.026961 0.9995543
## F1_S_SH-F1_C_RO          186.1550000  105.9630392  266.346961 0.0000000
## LA1511_C_RO-F1_C_RO      -53.5050000 -133.6969608   26.686961 0.6014737
## LA1511_C_SH-F1_C_RO      170.4150000   90.2230392  250.606961 0.0000000
## LA1511_S_RO-F1_C_RO      -92.7450000 -172.9369608  -12.553039 0.0084914
## LA1511_S_SH-F1_C_RO      -17.3150000  -97.5069608   62.876961 0.9999934
## M058_C_RO-F1_C_RO        -75.7950000 -155.9869608    4.396961 0.0859913
## M058_C_SH-F1_C_RO        117.3250000   37.1330392  197.516961 0.0001240
## M058_S_RO-F1_C_RO       -103.5750000 -194.8775638  -12.272436 0.0111113
## M058_S_SH-F1_C_RO        -16.5916667 -107.8942305   74.710897 0.9999994
## M248_C_RO-F1_C_RO        -24.7050000 -104.8969608   55.486961 0.9994216
## M248_C_SH-F1_C_RO        334.9350000  254.7430392  415.126961 0.0000000
## M248_S_RO-F1_C_RO        -83.6083333 -165.7564831   -1.460184 0.0415477
## M248_S_SH-F1_C_RO         11.1583333  -70.9898164   93.306483 1.0000000
## F1_S_RO-F1_C_SH         -477.2025000 -557.3944608 -397.010539 0.0000000
## F1_S_SH-F1_C_SH         -266.8825000 -347.0744608 -186.690539 0.0000000
## LA1511_C_RO-F1_C_SH     -506.5425000 -586.7344608 -426.350539 0.0000000
## LA1511_C_SH-F1_C_SH     -282.6225000 -362.8144608 -202.430539 0.0000000
## LA1511_S_RO-F1_C_SH     -545.7825000 -625.9744608 -465.590539 0.0000000
## LA1511_S_SH-F1_C_SH     -470.3525000 -550.5444608 -390.160539 0.0000000
## M058_C_RO-F1_C_SH       -528.8325000 -609.0244608 -448.640539 0.0000000
## M058_C_SH-F1_C_SH       -335.7125000 -415.9044608 -255.520539 0.0000000
## M058_S_RO-F1_C_SH       -556.6125000 -647.9150638 -465.309936 0.0000000
## M058_S_SH-F1_C_SH       -469.6291667 -560.9317305 -378.326603 0.0000000
## M248_C_RO-F1_C_SH       -477.7425000 -557.9344608 -397.550539 0.0000000
## M248_C_SH-F1_C_SH       -118.1025000 -198.2944608  -37.910539 0.0001071
## M248_S_RO-F1_C_SH       -536.6458333 -618.7939831 -454.497684 0.0000000
## M248_S_SH-F1_C_SH       -441.8791667 -524.0273164 -359.731017 0.0000000
## F1_S_SH-F1_S_RO          210.3200000  134.7142943  285.925706 0.0000000
## LA1511_C_RO-F1_S_RO      -29.3400000 -104.9457057   46.265706 0.9927295
## LA1511_C_SH-F1_S_RO      194.5800000  118.9742943  270.185706 0.0000000
## LA1511_S_RO-F1_S_RO      -68.5800000 -144.1857057    7.025706 0.1219552
## LA1511_S_SH-F1_S_RO        6.8500000  -68.7557057   82.455706 1.0000000
## M058_C_RO-F1_S_RO        -51.6300000 -127.2357057   23.975706 0.5612678
## M058_C_SH-F1_S_RO        141.4900000   65.8842943  217.095706 0.0000002
## M058_S_RO-F1_S_RO        -79.4100000 -166.7119491    7.891949 0.1192474
## M058_S_SH-F1_S_RO          7.5733333  -79.7286158   94.875282 1.0000000
## M248_C_RO-F1_S_RO         -0.5400000  -76.1457057   75.065706 1.0000000
## M248_C_SH-F1_S_RO        359.1000000  283.4942943  434.705706 0.0000000
## M248_S_RO-F1_S_RO        -59.4433333 -137.1208118   18.234145 0.3587847
## M248_S_SH-F1_S_RO         35.3233333  -42.3541452  113.000812 0.9676511
## LA1511_C_RO-F1_S_SH     -239.6600000 -315.2657057 -164.054294 0.0000000
## LA1511_C_SH-F1_S_SH      -15.7400000  -91.3457057   59.865706 0.9999960
## LA1511_S_RO-F1_S_SH     -278.9000000 -354.5057057 -203.294294 0.0000000
## LA1511_S_SH-F1_S_SH     -203.4700000 -279.0757057 -127.864294 0.0000000
## M058_C_RO-F1_S_SH       -261.9500000 -337.5557057 -186.344294 0.0000000
## M058_C_SH-F1_S_SH        -68.8300000 -144.4357057    6.775706 0.1184220
## M058_S_RO-F1_S_SH       -289.7300000 -377.0319491 -202.428051 0.0000000
## M058_S_SH-F1_S_SH       -202.7466667 -290.0486158 -115.444718 0.0000000
## M248_C_RO-F1_S_SH       -210.8600000 -286.4657057 -135.254294 0.0000000
## M248_C_SH-F1_S_SH        148.7800000   73.1742943  224.385706 0.0000000
## M248_S_RO-F1_S_SH       -269.7633333 -347.4408118 -192.085855 0.0000000
## M248_S_SH-F1_S_SH       -174.9966667 -252.6741452  -97.319188 0.0000000
## LA1511_C_SH-LA1511_C_RO  223.9200000  148.3142943  299.525706 0.0000000
## LA1511_S_RO-LA1511_C_RO  -39.2400000 -114.8457057   36.365706 0.9070408
## LA1511_S_SH-LA1511_C_RO   36.1900000  -39.4157057  111.795706 0.9502047
## M058_C_RO-LA1511_C_RO    -22.2900000  -97.8957057   53.315706 0.9996566
## M058_C_SH-LA1511_C_RO    170.8300000   95.2242943  246.435706 0.0000000
## M058_S_RO-LA1511_C_RO    -50.0700000 -137.3719491   37.231949 0.8185173
## M058_S_SH-LA1511_C_RO     36.9133333  -50.3886158  124.215282 0.9832261
## M248_C_RO-LA1511_C_RO     28.8000000  -46.8057057  104.405706 0.9939830
## M248_C_SH-LA1511_C_RO    388.4400000  312.8342943  464.045706 0.0000000
## M248_S_RO-LA1511_C_RO    -30.1033333 -107.7808118   47.574145 0.9928281
## M248_S_SH-LA1511_C_RO     64.6633333  -13.0141452  142.340812 0.2252747
## LA1511_S_RO-LA1511_C_SH -263.1600000 -338.7657057 -187.554294 0.0000000
## LA1511_S_SH-LA1511_C_SH -187.7300000 -263.3357057 -112.124294 0.0000000
## M058_C_RO-LA1511_C_SH   -246.2100000 -321.8157057 -170.604294 0.0000000
## M058_C_SH-LA1511_C_SH    -53.0900000 -128.6957057   22.515706 0.5117757
## M058_S_RO-LA1511_C_SH   -273.9900000 -361.2919491 -186.688051 0.0000000
## M058_S_SH-LA1511_C_SH   -187.0066667 -274.3086158  -99.704718 0.0000000
## M248_C_RO-LA1511_C_SH   -195.1200000 -270.7257057 -119.514294 0.0000000
## M248_C_SH-LA1511_C_SH    164.5200000   88.9142943  240.125706 0.0000000
## M248_S_RO-LA1511_C_SH   -254.0233333 -331.7008118 -176.345855 0.0000000
## M248_S_SH-LA1511_C_SH   -159.2566667 -236.9341452  -81.579188 0.0000000
## LA1511_S_SH-LA1511_S_RO   75.4300000   -0.1757057  151.035706 0.0512084
## M058_C_RO-LA1511_S_RO     16.9500000  -58.6557057   92.555706 0.9999892
## M058_C_SH-LA1511_S_RO    210.0700000  134.4642943  285.675706 0.0000000
## M058_S_RO-LA1511_S_RO    -10.8300000  -98.1319491   76.471949 1.0000000
## M058_S_SH-LA1511_S_RO     76.1533333  -11.1486158  163.455282 0.1643076
## M248_C_RO-LA1511_S_RO     68.0400000   -7.5657057  143.645706 0.1298705
## M248_C_SH-LA1511_S_RO    427.6800000  352.0742943  503.285706 0.0000000
## M248_S_RO-LA1511_S_RO      9.1366667  -68.5408118   86.814145 1.0000000
## M248_S_SH-LA1511_S_RO    103.9033333   26.2258548  181.580812 0.0007748
## M058_C_RO-LA1511_S_SH    -58.4800000 -134.0857057   17.125706 0.3405088
## M058_C_SH-LA1511_S_SH    134.6400000   59.0342943  210.245706 0.0000007
## M058_S_RO-LA1511_S_SH    -86.2600000 -173.5619491    1.041949 0.0564772
## M058_S_SH-LA1511_S_SH      0.7233333  -86.5786158   88.025282 1.0000000
## M248_C_RO-LA1511_S_SH     -7.3900000  -82.9957057   68.215706 1.0000000
## M248_C_SH-LA1511_S_SH    352.2500000  276.6442943  427.855706 0.0000000
## M248_S_RO-LA1511_S_SH    -66.2933333 -143.9708118   11.384145 0.1914514
## M248_S_SH-LA1511_S_SH     28.4733333  -49.2041452  106.150812 0.9959680
## M058_C_SH-M058_C_RO      193.1200000  117.5142943  268.725706 0.0000000
## M058_S_RO-M058_C_RO      -27.7800000 -115.0819491   59.521949 0.9991572
## M058_S_SH-M058_C_RO       59.2033333  -28.0986158  146.505282 0.5734474
## M248_C_RO-M058_C_RO       51.0900000  -24.5157057  126.695706 0.5796147
## M248_C_SH-M058_C_RO      410.7300000  335.1242943  486.335706 0.0000000
## M248_S_RO-M058_C_RO       -7.8133333  -85.4908118   69.864145 1.0000000
## M248_S_SH-M058_C_RO       86.9533333    9.2758548  164.630812 0.0132907
## M058_S_RO-M058_C_SH     -220.9000000 -308.2019491 -133.598051 0.0000000
## M058_S_SH-M058_C_SH     -133.9166667 -221.2186158  -46.614718 0.0000417
## M248_C_RO-M058_C_SH     -142.0300000 -217.6357057  -66.424294 0.0000001
## M248_C_SH-M058_C_SH      217.6100000  142.0042943  293.215706 0.0000000
## M248_S_RO-M058_C_SH     -200.9333333 -278.6108118 -123.255855 0.0000000
## M248_S_SH-M058_C_SH     -106.1666667 -183.8441452  -28.489188 0.0005121
## M058_S_SH-M058_S_RO       86.9833333  -10.6232130  184.589880 0.1401315
## M248_C_RO-M058_S_RO       78.8700000   -8.4319491  166.171949 0.1259604
## M248_C_SH-M058_S_RO      438.5100000  351.2080509  525.811949 0.0000000
## M248_S_RO-M058_S_RO       19.9666667  -69.1355120  109.068845 0.9999892
## M248_S_SH-M058_S_RO      114.7333333   25.6311547  203.835512 0.0015487
## M248_C_RO-M058_S_SH       -8.1133333  -95.4152824   79.188616 1.0000000
## M248_C_SH-M058_S_SH      351.5266667  264.2247176  438.828616 0.0000000
## M248_S_RO-M058_S_SH      -67.0166667 -156.1188453   22.085512 0.3888999
## M248_S_SH-M058_S_SH       27.7500000  -61.3521787  116.852179 0.9993432
## M248_C_SH-M248_C_RO      359.6400000  284.0342943  435.245706 0.0000000
## M248_S_RO-M248_C_RO      -58.9033333 -136.5808118   18.774145 0.3745936
## M248_S_SH-M248_C_RO       35.8633333  -41.8141452  113.540812 0.9631447
## M248_S_RO-M248_C_SH     -418.5433333 -496.2208118 -340.865855 0.0000000
## M248_S_SH-M248_C_SH     -323.7766667 -401.4541452 -246.099188 0.0000000
## M248_S_SH-M248_S_RO       94.7666667   15.0712553  174.462078 0.0056582
P5 = Output$All.ID[,'p adj']
stat.test<- multcompLetters(P5)
stat.test
##     F1_C_SH     F1_S_RO     F1_S_SH LA1511_C_RO LA1511_C_SH LA1511_S_RO 
##         "a"       "bcd"         "e"       "bcd"         "e"         "b" 
## LA1511_S_SH   M058_C_RO   M058_C_SH   M058_S_RO   M058_S_SH   M248_C_RO 
##       "bcd"        "bc"         "e"         "b"       "bcd"       "bcd" 
##   M248_C_SH   M248_S_RO   M248_S_SH     F1_C_RO 
##         "f"         "b"         "d"        "cd"
test <- as.data.frame(stat.test$Letters)
test$group1 <- rownames(test)
test$group2 <- rownames(test)
colnames(test)[1] <- "Tukey"
test
F1_FW_graph <- ggplot(data = F1_FW, mapping = aes(x = All.ID, y = FW.mg , colour = Condition)) 
F1_FW_graph  <- F1_FW_graph  + geom_boxplot(alpha=0.2) + geom_jitter(width=0.1,alpha=0.2)
F1_FW_graph  <- F1_FW_graph  + stat_summary(fun=mean, geom="point", shape=95, size=6, color="black", fill="black")
F1_FW_graph  <- F1_FW_graph  + scale_color_manual(values = c("blue","red"))
F1_FW_graph  <- F1_FW_graph  + ylab("Fresh weight, mg") + xlab("")
F1_FW_graph  <- F1_FW_graph  + theme(axis.text.x = element_text(angle=90, hjust=0.9, vjust=0.5))
F1_FW_graph  <- F1_FW_graph  + stat_pvalue_manual(test, label = "Tukey", y.position = 120) + rremove("legend")
F1_FW_graph 

pdf("F1.Fresh.weight.pdf", height = 5, width = 10)
plot(F1_FW_graph)
dev.off()
## png 
##   2
F1_FW_graph <- ggplot(data = F1_FW, mapping = aes(x = Condition, y = FW.mg, colour = Condition)) 
F1_FW_graph <- F1_FW_graph + geom_boxplot(alpha=0.2) + geom_jitter(width=0.1,alpha=0.2)
#To assign free scale for shoot and root, use the following code in faceting
F1_FW_graph <- F1_FW_graph + facet_grid(Tissue ~ Accession, scales = "free_y")

F1_FW_graph <- F1_FW_graph + stat_summary(fun=mean, geom="point", shape=95, size=6, color="black", fill="black")
F1_FW_graph <- F1_FW_graph + scale_color_manual(values = c("blue","red"))


F1_FW_graph <- F1_FW_graph + ylab("Fresh weight, mg") + xlab("")
F1_FW_graph <- F1_FW_graph + theme(axis.text.x = element_text(angle=90, hjust=0.9, vjust=0.5))
F1_FW_graph <- F1_FW_graph + rremove("legend")
#my_box_plot2 <- my_box_plot2 + stat_pvalue_manual(test, label = "Tukey", y.position = 80)
F1_FW_graph