This notebook describes the preliminary analysis of root anatomical features - along the lateral root developmental axis - collected by Emilly Miller - working in Magda Julkowska’s lab at Boyce Thompson Institute, Ithaca, NY.
The analysis itself was performed by Magda Julkowska
data <- read.csv("20250314_CrossSectionData_MMJ.csv")
data$Root.Area <- as.numeric(as.character(data$Root.Area))
## Warning: NAs introduced by coercion
data$Epidermis.Cell.Individual..1 <- as.numeric(as.character(data$Epidermis.Cell.Individual..1))
data$Epidermis.Cell.Individual..2 <- as.numeric(as.character(data$Epidermis.Cell.Individual..2))
data$Epidermis.Cell.Individual..3 <- as.numeric(as.character(data$Epidermis.Cell.Individual..3))
data$Epidermis.Cell.Individual..4 <- as.numeric(as.character(data$Epidermis.Cell.Individual..4))
data$Epidermis.Total <- as.numeric(as.character(data$Epidermis.Total))
## Warning: NAs introduced by coercion
data$Cortex.Cell.individual..1 <- as.numeric(as.character(data$Cortex.Cell.individual..1))
data$Cortex.Cell.individual..2 <- as.numeric(as.character(data$Cortex.Cell.individual..2))
data$Cortex.Cell.individual..3 <- as.numeric(as.character(data$Cortex.Cell.individual..3))
data$Cortex.Cell.individual..4 <- as.numeric(as.character(data$Cortex.Cell.individual..4))
data$Cortex.Total <- as.numeric(as.character(data$Cortex.Total))
data$Endodermis.Cell.Individual..1 <- as.numeric(as.character(data$Endodermis.Cell.Individual..1))
data$Endodermis.Cell.Individual..2 <- as.numeric(as.character(data$Endodermis.Cell.Individual..2))
data$Endodermis.Cell.Individual..3 <- as.numeric(as.character(data$Endodermis.Cell.Individual..3))
data$Endodermis.Cell.Individual..4 <- as.numeric(as.character(data$Endodermis.Cell.Individual..4))
data$Endodermis.Total <- as.numeric(as.character(data$Endodermis.Total))
data$Vasculature.Cell.Size.Individual..1 <- as.numeric(as.character(data$Vasculature.Cell.Size.Individual..1))
data$Vasculature.Cell.Size.Individual..2 <- as.numeric(as.character(data$Vasculature.Cell.Size.Individual..2))
data$Vasculature.Cell.Size.Individual..3 <- as.numeric(as.character(data$Vasculature.Cell.Size.Individual..3))
data$Vasculature.Cell.Size.Individual..4 <- as.numeric(as.character(data$Vasculature.Cell.Size.Individual..4))
data$Vasculature.Total <- as.numeric(as.character(data$Vasculature.Total))
data$Number.of.Cortex.Layers <- gsub("?", "", data$Number.of.Cortex.Layers)
data$Number.of.Cortex.Layers <- as.numeric(as.character(data$Number.of.Cortex.Layers))
## Warning: NAs introduced by coercion
data
OK - first let’s have a look at the overall root surface:
library(ggplot2)
library(ggpubr)
library(ggbeeswarm)
library(ggsci)
## Warning: package 'ggsci' was built under R version 4.3.3
my_comparisons <- list(c("LR_Proximal", "LR_Mid"), c("LR_Mid", "LR_Tip"), c("LR_Proximal", "LR_Tip"))
RootArea <- ggerrorplot(data, x = "Root.Section", y = "Root.Area", color = "Root.Section", fill = "Root.Section",
desc_stat = "mean_sd", add = "jitter", ncol = 2,
xlab="", ylab= "Root Area (a.u.)", add.params = list(color = "darkgray")) + color_palette("aaas")
RootArea <- RootArea + stat_compare_means(method = "aov", label.y = 1700000)
RootArea <- RootArea + stat_compare_means(comparisons = my_comparisons)
RootArea <- RootArea + rremove("legend") + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))
RootArea
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_summary()`).
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_compare_means()`).
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_signif()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).
OK - let’s check other bulk traits:
EpiArea <- ggerrorplot(data, x = "Root.Section", y = "Epidermis.Total", color = "Root.Section", fill = "Root.Section",
desc_stat = "mean_sd", add = "jitter", ncol = 2,
xlab="", ylab= "Epidermis Area (a.u.)", add.params = list(color = "darkgray")) + color_palette("aaas")
EpiArea <- EpiArea + stat_compare_means(method = "aov", label.y = 500000)
EpiArea <- EpiArea + stat_compare_means(comparisons = my_comparisons)
EpiArea <- EpiArea + rremove("legend") + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))
EpiArea
## Warning: Removed 3 rows containing non-finite outside the scale range
## (`stat_summary()`).
## Warning: Removed 3 rows containing non-finite outside the scale range
## (`stat_compare_means()`).
## Warning: Removed 3 rows containing non-finite outside the scale range
## (`stat_signif()`).
## Warning: Removed 3 rows containing missing values or values outside the scale range
## (`geom_point()`).
CorArea <- ggerrorplot(data, x = "Root.Section", y = "Cortex.Total", color = "Root.Section", fill = "Root.Section",
desc_stat = "mean_sd", add = "jitter", ncol = 2,
xlab="", ylab= "Cortex Area (a.u.)", add.params = list(color = "darkgray")) + color_palette("aaas")
CorArea <- CorArea + stat_compare_means(method = "aov", label.y = 300000)
CorArea <- CorArea + stat_compare_means(comparisons = my_comparisons)
CorArea <- CorArea + rremove("legend") + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))
CorArea
## Warning: Removed 3 rows containing non-finite outside the scale range
## (`stat_summary()`).
## Warning: Removed 3 rows containing non-finite outside the scale range
## (`stat_compare_means()`).
## Warning: Removed 3 rows containing non-finite outside the scale range
## (`stat_signif()`).
## Warning: Removed 3 rows containing missing values or values outside the scale range
## (`geom_point()`).
EndoArea <- ggerrorplot(data, x = "Root.Section", y = "Endodermis.Total", color = "Root.Section", fill = "Root.Section",
desc_stat = "mean_sd", add = "jitter", ncol = 2,
xlab="", ylab= "Cortex Area (a.u.)", add.params = list(color = "darkgray")) + color_palette("aaas")
EndoArea <- EndoArea + stat_compare_means(method = "aov", label.y = 200000)
EndoArea <- EndoArea + stat_compare_means(comparisons = my_comparisons)
EndoArea <- EndoArea + rremove("legend") + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))
EndoArea
## Warning: Removed 3 rows containing non-finite outside the scale range
## (`stat_summary()`).
## Warning: Removed 3 rows containing non-finite outside the scale range
## (`stat_compare_means()`).
## Warning: Removed 3 rows containing non-finite outside the scale range
## (`stat_signif()`).
## Warning: Removed 3 rows containing missing values or values outside the scale range
## (`geom_point()`).
VascArea <- ggerrorplot(data, x = "Root.Section", y = "Vasculature.Total", color = "Root.Section", fill = "Root.Section",
desc_stat = "mean_sd", add = "jitter", ncol = 2,
xlab="", ylab= "Vasculature Area (a.u.)", add.params = list(color = "darkgray")) + color_palette("aaas")
VascArea <- VascArea + stat_compare_means(method = "aov", label.y = 120000)
VascArea <- VascArea + stat_compare_means(comparisons = my_comparisons)
VascArea <- VascArea + rremove("legend") + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))
VascArea
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_summary()`).
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_compare_means()`).
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_signif()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).
OK - now let’s have a look at the individual cell sizes within each layer.
First - we need to melt the data frame:
library(reshape2)
data
data_melt <- melt(data, id=c("Image.Name", "Root.Section"))
data_melt
now - we need to remove all of the ..1 to ..4:
data_melt$variable <- gsub("..1", "", data_melt$variable)
data_melt$variable <- gsub("..2", "", data_melt$variable)
data_melt$variable <- gsub("..3", "", data_melt$variable)
data_melt$variable <- gsub("..4", "", data_melt$variable)
data_melt
Now - let’s plot all of the variables just for the fun of it:
# we dont need all of the variables - especially count based ones:
unique(data_melt$variable)
## [1] "Root.Area" "Epidermis.Cell.Individual"
## [3] "Epidermis.Total" "Cortex.Cell.individual"
## [5] "Cortex.Total" "Number.of.Cortex.Layers"
## [7] "Endodermis.Cell.Individual" "Endodermis.Total"
## [9] "Vasculature.Cell.Size.Individual" "Vasculature.Total"
## [11] "Xylem.Bundle.Sheath.Present.or.0." "Number.of.XBS"
## [13] "Surface.Area.of.XBS" "Surface.Area.of.XBS.1"
## [15] "Surface.Area.of.XB" "Surface.Area.of.XBS.5"
## [17] "Surface.Area.of.XBS.6" "Surface.Area.of.XBS.7"
bye <- c("Number.of.Cortex.Layers", "Xylem.Bundle.Sheath.Present.or.0.", "Number.of.XBS", "Surface.Area.of.XBS", "Surface.Area.of.XB",
"Surface.Area.of.XBS.5", "Surface.Area.of.XBS.6", "Surface.Area.of.XBS.7","Vasculature.Cell.Size.Individual")
data_melt2 <- subset(data_melt, !(data_melt$variable %in% bye))
data_melt2$value <- as.numeric(as.character(data_melt2$value))
data_melt2$Root.Section <- factor(data_melt2$Root.Section, levels = c("LR_Tip", "LR_Mid", "LR_Proximal"))
unique(data_melt2$variable)
## [1] "Root.Area" "Epidermis.Cell.Individual"
## [3] "Epidermis.Total" "Cortex.Cell.individual"
## [5] "Cortex.Total" "Endodermis.Cell.Individual"
## [7] "Endodermis.Total" "Vasculature.Total"
## [9] "Surface.Area.of.XBS.1"
data_melt2$variable <- factor(data_melt2$variable, levels = c("Root.Area", "Epidermis.Total", "Cortex.Total", "Endodermis.Total", "Vasculature.Total", "Epidermis.Cell.Individual", "Cortex.Cell.individual", "Endodermis.Cell.Individual"))
AllArea <- ggerrorplot(data_melt2, x = "variable", y = "value", color = "variable", fill = "variable",
desc_stat = "mean_sd", add = "jitter", ncol = 1, facet.by = "Root.Section",
xlab="", ylab= "Area (a.u.)", add.params = list(color = "darkgray")) + color_palette("aaas")
AllArea <- AllArea + stat_compare_means(method = "aov", label.y = 1200000)
#AllArea <- AllArea + stat_compare_means(comparisons = my_comparisons)
AllArea <- AllArea + rremove("legend") + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))
AllArea
## Warning: Removed 140 rows containing non-finite outside the scale range
## (`stat_summary()`).
## Warning: Removed 140 rows containing non-finite outside the scale range
## (`stat_compare_means()`).
## Warning: Removed 140 rows containing missing values or values outside the scale range
## (`geom_point()`).
Now - let’s add the sig. different groups to this graph:
library(stringr)
library(multcompView)
LR_Tip <- subset(data_melt2, data_melt2$Root.Section == "LR_Tip")
LR_Mid <- subset(data_melt2, data_melt2$Root.Section == "LR_Mid")
LR_Proximal <- subset(data_melt2, data_melt2$Root.Section == "LR_Proximal")
LR_Tip$variable <- as.factor(LR_Tip$variable)
LR_Mid$variable <- as.factor(LR_Mid$variable)
LR_Proximal$variable <- as.factor(LR_Proximal$variable)
Output <- TukeyHSD(aov(value ~ variable, data = LR_Tip))
Output$variable
## diff lwr
## Epidermis.Total-Root.Area -286086.3333 -355631.64
## Cortex.Total-Root.Area -345852.1250 -417648.67
## Endodermis.Total-Root.Area -376147.7500 -447944.29
## Vasculature.Total-Root.Area -396900.1111 -466445.42
## Epidermis.Cell.Individual-Root.Area -423886.5250 -477400.51
## Cortex.Cell.individual-Root.Area -423102.6750 -476616.66
## Endodermis.Cell.Individual-Root.Area -424099.9375 -478935.45
## Cortex.Total-Epidermis.Total -59765.7917 -133313.73
## Endodermis.Total-Epidermis.Total -90061.4167 -163609.35
## Vasculature.Total-Epidermis.Total -110813.7778 -182165.76
## Epidermis.Cell.Individual-Epidermis.Total -137800.1917 -193641.95
## Cortex.Cell.individual-Epidermis.Total -137016.3417 -192858.10
## Endodermis.Cell.Individual-Epidermis.Total -138013.6042 -195123.05
## Endodermis.Total-Cortex.Total -30295.6250 -105975.83
## Vasculature.Total-Cortex.Total -51047.9861 -124595.92
## Epidermis.Cell.Individual-Cortex.Total -78034.4000 -136656.03
## Cortex.Cell.individual-Cortex.Total -77250.5500 -135872.18
## Endodermis.Cell.Individual-Cortex.Total -78247.8125 -138078.27
## Vasculature.Total-Endodermis.Total -20752.3611 -94300.30
## Epidermis.Cell.Individual-Endodermis.Total -47738.7750 -106360.41
## Cortex.Cell.individual-Endodermis.Total -46954.9250 -105576.56
## Endodermis.Cell.Individual-Endodermis.Total -47952.1875 -107782.64
## Epidermis.Cell.Individual-Vasculature.Total -26986.4139 -82828.17
## Cortex.Cell.individual-Vasculature.Total -26202.5639 -82044.32
## Endodermis.Cell.Individual-Vasculature.Total -27199.8264 -84309.28
## Cortex.Cell.individual-Epidermis.Cell.Individual 783.8500 -33061.37
## Endodermis.Cell.Individual-Epidermis.Cell.Individual -213.4125 -36111.68
## Endodermis.Cell.Individual-Cortex.Cell.individual -997.2625 -36895.53
## upr p adj
## Epidermis.Total-Root.Area -216541.03 2.442491e-14
## Cortex.Total-Root.Area -274055.58 2.309264e-14
## Endodermis.Total-Root.Area -304351.21 2.309264e-14
## Vasculature.Total-Root.Area -327354.80 2.309264e-14
## Epidermis.Cell.Individual-Root.Area -370372.54 2.309264e-14
## Cortex.Cell.individual-Root.Area -369588.69 2.309264e-14
## Endodermis.Cell.Individual-Root.Area -369264.42 2.309264e-14
## Cortex.Total-Epidermis.Total 13782.15 2.042557e-01
## Endodermis.Total-Epidermis.Total -16513.48 5.728357e-03
## Vasculature.Total-Epidermis.Total -39461.80 1.141592e-04
## Epidermis.Cell.Individual-Epidermis.Total -81958.43 9.383072e-11
## Cortex.Cell.individual-Epidermis.Total -81174.58 1.191807e-10
## Endodermis.Cell.Individual-Epidermis.Total -80904.16 2.232849e-10
## Endodermis.Total-Cortex.Total 45384.58 9.214387e-01
## Vasculature.Total-Cortex.Total 22499.95 3.981746e-01
## Epidermis.Cell.Individual-Cortex.Total -19412.77 1.754030e-03
## Cortex.Cell.individual-Cortex.Total -18628.92 2.044721e-03
## Endodermis.Cell.Individual-Cortex.Total -18417.36 2.289995e-03
## Vasculature.Total-Endodermis.Total 52795.58 9.884452e-01
## Epidermis.Cell.Individual-Endodermis.Total 10882.86 2.019846e-01
## Cortex.Cell.individual-Endodermis.Total 11666.71 2.198462e-01
## Endodermis.Cell.Individual-Endodermis.Total 11878.27 2.191802e-01
## Epidermis.Cell.Individual-Vasculature.Total 28855.34 8.138107e-01
## Cortex.Cell.individual-Vasculature.Total 29639.19 8.357189e-01
## Endodermis.Cell.Individual-Vasculature.Total 29909.62 8.248969e-01
## Cortex.Cell.individual-Epidermis.Cell.Individual 34629.07 1.000000e+00
## Endodermis.Cell.Individual-Epidermis.Cell.Individual 35684.86 1.000000e+00
## Endodermis.Cell.Individual-Cortex.Cell.individual 34901.01 1.000000e+00
P7 = Output$variable[,'p adj']
stat.test<- multcompLetters(P7)
testc <- as.data.frame(stat.test$Letters)
testc$group2 <- rownames(testc)
testc$group1 <- rownames(testc)
testc$variable <- rownames(testc)
testc$variable <- rownames(testc)
colnames(testc)[1] <- "Tukey"
testc$Root.Section <- "LR_Tip"
testc
Output <- TukeyHSD(aov(value ~ variable, data = LR_Mid))
Output$variable
## diff lwr
## Epidermis.Total-Root.Area -434838.2222 -512522.55
## Cortex.Total-Root.Area -501470.4444 -579154.77
## Endodermis.Total-Root.Area -535600.4444 -613284.77
## Vasculature.Total-Root.Area -556173.9111 -631891.23
## Epidermis.Cell.Individual-Root.Area -589372.7049 -651550.51
## Cortex.Cell.individual-Root.Area -587359.7611 -648157.36
## Endodermis.Cell.Individual-Root.Area -590069.9861 -652247.79
## Cortex.Total-Epidermis.Total -66632.2222 -144316.55
## Endodermis.Total-Epidermis.Total -100762.2222 -178446.55
## Vasculature.Total-Epidermis.Total -121335.6889 -197053.01
## Epidermis.Cell.Individual-Epidermis.Total -154534.4826 -216712.28
## Cortex.Cell.individual-Epidermis.Total -152521.5389 -213319.14
## Endodermis.Cell.Individual-Epidermis.Total -155231.7639 -217409.56
## Endodermis.Total-Cortex.Total -34130.0000 -111814.33
## Vasculature.Total-Cortex.Total -54703.4667 -130420.78
## Epidermis.Cell.Individual-Cortex.Total -87902.2604 -150080.06
## Cortex.Cell.individual-Cortex.Total -85889.3167 -146686.92
## Endodermis.Cell.Individual-Cortex.Total -88599.5417 -150777.34
## Vasculature.Total-Endodermis.Total -20573.4667 -96290.78
## Epidermis.Cell.Individual-Endodermis.Total -53772.2604 -115950.06
## Cortex.Cell.individual-Endodermis.Total -51759.3167 -112556.92
## Endodermis.Cell.Individual-Endodermis.Total -54469.5417 -116647.34
## Epidermis.Cell.Individual-Vasculature.Total -33198.7938 -92900.86
## Cortex.Cell.individual-Vasculature.Total -31185.8500 -89449.10
## Endodermis.Cell.Individual-Vasculature.Total -33896.0750 -93598.14
## Cortex.Cell.individual-Epidermis.Cell.Individual 2012.9438 -37071.23
## Endodermis.Cell.Individual-Epidermis.Cell.Individual -697.2812 -41895.62
## Endodermis.Cell.Individual-Cortex.Cell.individual -2710.2250 -41794.40
## upr p adj
## Epidermis.Total-Root.Area -357153.894 0.000000e+00
## Cortex.Total-Root.Area -423786.116 0.000000e+00
## Endodermis.Total-Root.Area -457916.116 0.000000e+00
## Vasculature.Total-Root.Area -480456.594 0.000000e+00
## Epidermis.Cell.Individual-Root.Area -527194.904 0.000000e+00
## Cortex.Cell.individual-Root.Area -526562.157 0.000000e+00
## Endodermis.Cell.Individual-Root.Area -527892.185 0.000000e+00
## Cortex.Total-Epidermis.Total 11052.106 1.509186e-01
## Endodermis.Total-Epidermis.Total -23077.894 2.604670e-03
## Vasculature.Total-Epidermis.Total -45618.372 6.082023e-05
## Epidermis.Cell.Individual-Epidermis.Total -92356.682 7.923340e-11
## Cortex.Cell.individual-Epidermis.Total -91723.935 5.335121e-11
## Endodermis.Cell.Individual-Epidermis.Total -93053.963 6.551526e-11
## Endodermis.Total-Cortex.Total 43554.328 8.770631e-01
## Vasculature.Total-Cortex.Total 21013.851 3.446171e-01
## Epidermis.Cell.Individual-Cortex.Total -25724.460 6.687252e-04
## Cortex.Cell.individual-Cortex.Total -25091.713 6.769733e-04
## Endodermis.Cell.Individual-Cortex.Total -26421.741 5.837607e-04
## Vasculature.Total-Endodermis.Total 55143.851 9.907223e-01
## Epidermis.Cell.Individual-Endodermis.Total 8405.540 1.436256e-01
## Cortex.Cell.individual-Endodermis.Total 9038.287 1.577356e-01
## Endodermis.Cell.Individual-Endodermis.Total 7708.259 1.326319e-01
## Epidermis.Cell.Individual-Vasculature.Total 26503.268 6.802354e-01
## Cortex.Cell.individual-Vasculature.Total 27077.396 7.210190e-01
## Endodermis.Cell.Individual-Vasculature.Total 25805.987 6.566763e-01
## Cortex.Cell.individual-Epidermis.Cell.Individual 41097.118 9.999999e-01
## Endodermis.Cell.Individual-Epidermis.Cell.Individual 40501.055 1.000000e+00
## Endodermis.Cell.Individual-Cortex.Cell.individual 36373.949 9.999989e-01
P7 = Output$variable[,'p adj']
stat.test<- multcompLetters(P7)
testd <- as.data.frame(stat.test$Letters)
testd$group2 <- rownames(testd)
testd$group1 <- rownames(testd)
testd$variable <- rownames(testd)
testd$variable <- rownames(testd)
colnames(testd)[1] <- "Tukey"
testd$Root.Section <- "LR_Mid"
testd
Output <- TukeyHSD(aov(value ~ variable, data = LR_Proximal))
Output$variable
## diff lwr
## Epidermis.Total-Root.Area -477440.931 -629792.7
## Cortex.Total-Root.Area -557606.667 -705409.6
## Endodermis.Total-Root.Area -604509.222 -752312.2
## Vasculature.Total-Root.Area -619822.111 -767625.0
## Epidermis.Cell.Individual-Root.Area -668790.222 -807047.2
## Cortex.Cell.individual-Root.Area -667056.639 -805313.6
## Endodermis.Cell.Individual-Root.Area -670199.556 -822551.3
## Cortex.Total-Epidermis.Total -80165.736 -232517.5
## Endodermis.Total-Epidermis.Total -127068.292 -279420.1
## Vasculature.Total-Epidermis.Total -142381.181 -294733.0
## Epidermis.Cell.Individual-Epidermis.Total -191349.292 -334458.9
## Cortex.Cell.individual-Epidermis.Total -189615.708 -332725.3
## Endodermis.Cell.Individual-Epidermis.Total -192758.625 -349527.3
## Endodermis.Total-Cortex.Total -46902.556 -194705.5
## Vasculature.Total-Cortex.Total -62215.444 -210018.4
## Epidermis.Cell.Individual-Cortex.Total -111183.556 -249440.5
## Cortex.Cell.individual-Cortex.Total -109449.972 -247707.0
## Endodermis.Cell.Individual-Cortex.Total -112592.889 -264944.7
## Vasculature.Total-Endodermis.Total -15312.889 -163115.8
## Epidermis.Cell.Individual-Endodermis.Total -64281.000 -202538.0
## Cortex.Cell.individual-Endodermis.Total -62547.417 -200804.4
## Endodermis.Cell.Individual-Endodermis.Total -65690.333 -218042.1
## Epidermis.Cell.Individual-Vasculature.Total -48968.111 -187225.1
## Cortex.Cell.individual-Vasculature.Total -47234.528 -185491.5
## Endodermis.Cell.Individual-Vasculature.Total -50377.444 -202729.2
## Cortex.Cell.individual-Epidermis.Cell.Individual 1733.583 -126267.5
## Endodermis.Cell.Individual-Epidermis.Cell.Individual -1409.333 -144518.9
## Endodermis.Cell.Individual-Cortex.Cell.individual -3142.917 -146252.5
## upr p adj
## Epidermis.Total-Root.Area -325089.15 0.000000000
## Cortex.Total-Root.Area -409803.73 0.000000000
## Endodermis.Total-Root.Area -456706.28 0.000000000
## Vasculature.Total-Root.Area -472019.17 0.000000000
## Epidermis.Cell.Individual-Root.Area -530533.23 0.000000000
## Cortex.Cell.individual-Root.Area -528799.65 0.000000000
## Endodermis.Cell.Individual-Root.Area -517847.77 0.000000000
## Cortex.Total-Epidermis.Total 72186.04 0.721223622
## Endodermis.Total-Epidermis.Total 25283.49 0.170999055
## Vasculature.Total-Epidermis.Total 9970.60 0.083853633
## Epidermis.Cell.Individual-Epidermis.Total -48239.71 0.002062682
## Cortex.Cell.individual-Epidermis.Total -46506.13 0.002342259
## Endodermis.Cell.Individual-Epidermis.Total -35989.94 0.006191358
## Endodermis.Total-Cortex.Total 100900.38 0.974044816
## Vasculature.Total-Cortex.Total 85587.49 0.889511176
## Epidermis.Cell.Individual-Cortex.Total 27073.43 0.206981464
## Cortex.Cell.individual-Cortex.Total 28807.02 0.223586388
## Endodermis.Cell.Individual-Cortex.Total 39758.89 0.302906938
## Vasculature.Total-Endodermis.Total 132490.05 0.999979905
## Epidermis.Cell.Individual-Endodermis.Total 73975.99 0.828420139
## Cortex.Cell.individual-Endodermis.Total 75709.57 0.847337159
## Endodermis.Cell.Individual-Endodermis.Total 86661.45 0.876639801
## Epidermis.Cell.Individual-Vasculature.Total 89288.88 0.953000026
## Cortex.Cell.individual-Vasculature.Total 91022.46 0.961170497
## Endodermis.Cell.Individual-Vasculature.Total 101974.34 0.967448058
## Cortex.Cell.individual-Epidermis.Cell.Individual 129734.68 1.000000000
## Endodermis.Cell.Individual-Epidermis.Cell.Individual 141700.25 1.000000000
## Endodermis.Cell.Individual-Cortex.Cell.individual 139966.66 1.000000000
P7 = Output$variable[,'p adj']
stat.test<- multcompLetters(P7)
teste <- as.data.frame(stat.test$Letters)
teste$group2 <- rownames(teste)
teste$group1 <- rownames(teste)
teste$variable <- rownames(teste)
teste$variable <- rownames(teste)
colnames(teste)[1] <- "Tukey"
teste$Root.Section <- "LR_Proximal"
teste
test <- rbind(testc, testd, teste)
test
AllArea <- AllArea + stat_pvalue_manual(test, label = "Tukey", y.position = 1000000)
AllArea
## Warning: Removed 140 rows containing non-finite outside the scale range
## (`stat_summary()`).
## Warning: Removed 140 rows containing non-finite outside the scale range
## (`stat_compare_means()`).
## Warning: Removed 140 rows containing missing values or values outside the scale range
## (`geom_point()`).
pdf("Area_All_facet_per_Root_segment.pdf", height = 15, width = 7)
plot(AllArea)
## Warning: Removed 140 rows containing non-finite outside the scale range
## (`stat_summary()`).
## Warning: Removed 140 rows containing non-finite outside the scale range
## (`stat_compare_means()`).
## Warning: Removed 140 rows containing missing values or values outside the scale range
## (`geom_point()`).
dev.off()
## quartz_off_screen
## 2
OK - let’s try another way to plot this:
AllArea2 <- ggerrorplot(data_melt2, x = "Root.Section", y = "value", color = "Root.Section", fill = "Root.Section",
desc_stat = "mean_sd", add = "jitter", facet.by = "variable", scales="free", ncol = 4,
xlab="", ylab= "Area (a.u.)", add.params = list(color = "darkgray")) + color_palette("aaas")
AllArea2 <- AllArea2 + stat_compare_means(method = "aov")
AllArea2 <- AllArea2 + stat_compare_means(comparisons = my_comparisons)
AllArea2 <- AllArea2 + rremove("legend") + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))
AllArea2
## Warning: Removed 140 rows containing non-finite outside the scale range
## (`stat_summary()`).
## Warning: Removed 140 rows containing non-finite outside the scale range
## (`stat_compare_means()`).
## Warning: Removed 140 rows containing non-finite outside the scale range
## (`stat_signif()`).
## Warning in wilcox.test.default(c(3082, NA, 1649, 2007, 1004, 1340, 1468, :
## cannot compute exact p-value with ties
## Warning in wilcox.test.default(c(4050, 1916, 5402, NA, NA, NA, NA, NA, NA, :
## cannot compute exact p-value with ties
## Warning in wilcox.test.default(c(10132, 4541, 2006, 3147, 5665, 1770, 8809, :
## cannot compute exact p-value with ties
## Warning in wilcox.test.default(c(9360, 2349, 4974, NA, NA, NA, NA, NA, NA, :
## cannot compute exact p-value with ties
## Warning in wilcox.test.default(c(9360, 2349, 4974, NA, NA, NA, NA, NA, NA, :
## cannot compute exact p-value with ties
## Warning in wilcox.test.default(c(1748, 1317, 1201, NA, 656, 1264, 1292, :
## cannot compute exact p-value with ties
## Warning in wilcox.test.default(c(3601, NA, 1648, NA, NA, NA, NA, NA, NA, :
## cannot compute exact p-value with ties
## Warning in wilcox.test.default(c(3601, NA, 1648, NA, NA, NA, NA, NA, NA, :
## cannot compute exact p-value with ties
## Warning: Removed 140 rows containing missing values or values outside the scale range
## (`geom_point()`).
pdf("Area_All_facet_within_Root_segment.pdf", height = 7, width = 10)
plot(AllArea2)
## Warning: Removed 140 rows containing non-finite outside the scale range
## (`stat_summary()`).
## Warning: Removed 140 rows containing non-finite outside the scale range
## (`stat_compare_means()`).
## Warning: Removed 140 rows containing non-finite outside the scale range
## (`stat_signif()`).
## Warning in wilcox.test.default(c(3082, NA, 1649, 2007, 1004, 1340, 1468, :
## cannot compute exact p-value with ties
## Warning in wilcox.test.default(c(4050, 1916, 5402, NA, NA, NA, NA, NA, NA, :
## cannot compute exact p-value with ties
## Warning in wilcox.test.default(c(10132, 4541, 2006, 3147, 5665, 1770, 8809, :
## cannot compute exact p-value with ties
## Warning in wilcox.test.default(c(9360, 2349, 4974, NA, NA, NA, NA, NA, NA, :
## cannot compute exact p-value with ties
## Warning in wilcox.test.default(c(9360, 2349, 4974, NA, NA, NA, NA, NA, NA, :
## cannot compute exact p-value with ties
## Warning in wilcox.test.default(c(1748, 1317, 1201, NA, 656, 1264, 1292, :
## cannot compute exact p-value with ties
## Warning in wilcox.test.default(c(3601, NA, 1648, NA, NA, NA, NA, NA, NA, :
## cannot compute exact p-value with ties
## Warning in wilcox.test.default(c(3601, NA, 1648, NA, NA, NA, NA, NA, NA, :
## cannot compute exact p-value with ties
## Warning: Removed 140 rows containing missing values or values outside the scale range
## (`geom_point()`).
dev.off()
## quartz_off_screen
## 2