# boxplot -Essentials library(ggplot2) library(agricolae) library(dplyr)# 1st and then run value max first library(Rmisc) library(ggpubr) S2=Wako View(S2) str(S2) S2$Condition=as.factor(S2$Condition) S2$Replicate=factor(S2$Replicate) # use this if you want to reorder your treat. S2$Condition % group_by(Condition) %>% summarize(max_value = max(GY)) # boxplot Du=S2%>% ggplot(aes(x=Condition, y=GY, color=Condition))+ geom_boxplot(outlier.shape=NA)+ geom_jitter(width=0.2, size=2.2,alpha=0.5,aes(shape=Replicate))+theme_classic() # Rotate axis text labels Du+theme(axis.text.x = element_text(angle = 45,hjust = 1)) # Remove axis ticks mark and text Du+theme(axis.text.x = element_blank(), axis.ticks = element_blank()) #Change the color, the size and the line type of axis lines: Du+ theme(axis.line = element_line(color = "red", size = 1, linetype = "solid")) # Break y axis by a specified value Du + scale_y_continuous(breaks=c(0, 500000, 800000,1000000)) # Format y axis labels in percent (%) require(scales) Du+ scale_y_continuous(labels = percent) # Scientific Du+scale_y_continuous(labels = scientific) # Dollar Du + scale_y_continuous(labels = dollar) # fill boxplot based on your treat -randomly Du1=Du+geom_boxplot(aes(fill=Condition)) # fill boxplot color manually Du2=Du1+scale_fill_manual(breaks = c("RDC","BC","MC","BMS"), values=c("black", "red","blue","skyblue1")) # match points to fill color s=Du2+scale_color_manual(breaks = c("RDC","BC", "MC","BMS"), values=c("black", "red","blue","skyblue1")) # Remove legend for a particular aesthetic (fill) Du3=s+guides(color="none")+guides(fill="none") # This removes all legends Du3+ theme(legend.position="none") # to make transparent Du4=Du3+ scale_fill_manual(values = alpha(c("black", "red","blue","skyblue1"), .6)) # decorate the legend Du5=Du4+theme(legend.background = element_rect(size=0.5, linetype="solid", colour ="red")) # legend lables and text Du6=Du5+theme(legend.title = element_text(colour="black", size=16, face="bold")) # legend labels Du7=Du6 + theme(legend.text = element_text(colour="red", size=14, face="bold")) #Du7+xlab(element_blank()) Du8=Du7+theme(axis.text.x = element_text(face="bold",color="black", size=12), axis.text.y = element_text(face="bold", color="black", size=12))+theme(axis.title.x = element_text(face="bold", color="black", size=14))+theme(axis.title.y = element_text(face="bold", color="black",size=14)) ################## hsd=HSD.test(aov(GY~Condition, data=S2), trt = "Condition", group = T) sig.letters
@bacarabdallahabderemane5279
Жыл бұрын
Thank you for your reply. But I used that script you shared. At the stage where I have to include the letters on the plot boxes is where this error message appears.
@wakjiratesfahun3682
Жыл бұрын
@@bacarabdallahabderemane5279 share with me the pseudo data with this email address and I will figure out. wakjiratesfahun@gmail.com
@bacarabdallahabderemane5279
Жыл бұрын
Thanks you
@jinlingli9728
Жыл бұрын
would you please share your original data to us?
@wakjiratesfahun3682
Жыл бұрын
@@jinlingli9728 okay
@TeferiMekonnin-l2w
9 ай бұрын
wakjira your video is always a constructive and we Thanks you for your best attitude to give what you have for other students who follow you!!!!
@deressakenea9292
Жыл бұрын
Keep up the endurance, thank you.
@wakjiratesfahun3682
Жыл бұрын
Thank you Abuji.
@deressakenea9292
Жыл бұрын
Thanks for endurance work.
@wakjiratesfahun3682
Жыл бұрын
Thank You so much.
@ManzoorRaieesKhan
Жыл бұрын
Thanks for uploading
@wakjiratesfahun3682
Жыл бұрын
Thanks
@JuHP-hy1jo
Жыл бұрын
Great work.
@wakjiratesfahun3682
Жыл бұрын
Thank you.
@beneberuteferra1870
Жыл бұрын
Thank you so much for your help, Respect!👍
@wakjiratesfahun3682
Жыл бұрын
Thank you.
@kitilederessa9627
Жыл бұрын
Wow
@wakjiratesfahun3682
Жыл бұрын
Thank you.
@LifewithAttaullahKhan
5 ай бұрын
Please do the same box plot for 12 species and with a significant letters, I am doing it but facing. Thanks in advance.
@wakjiratesfahun3682
5 ай бұрын
The procedure is the same. Try again or share the problem.
@vaibhavchaudhary-yo4cw
11 ай бұрын
Thank you for your script for analysisng data. But I used that script you shared. At the stage where I have to include the letters on the plot boxes is where this error message appears. Can you please help me?
@wakjiratesfahun3682
11 ай бұрын
what was the error?
@techalebirhan1399
Жыл бұрын
Good job , thank you.
@wakjiratesfahun3682
Жыл бұрын
Thank you dr.
@bacarabdallahabderemane5279
Жыл бұрын
Hello can you help me please every time i get to the stage where i have to add the letters to the boxplots, i get this message > velplo=Du8+geom_text(data = value_max, aes(x= Treatement, + y = 900000, label = sig.letters$groups),vjust=0)+stat_boxplot(geom = 'errorbar', + width = 0.1)+ ggtitle("a") > velplo Error in `geom_text()`: ! Problem while computing aesthetics. ℹ Error occurred in the 4th layer. Caused by error in `FUN()`: ! object 'Treatement' not found Run `rlang::last_error()` to see where the error occurred.
@wakjiratesfahun3682
Жыл бұрын
The problem is you haven't treatment in your data.
@poliyugandhar4614
Жыл бұрын
Hello Wakjira tesfahun your videos are so useful. I want to ask you that you are taking any online classes regarding R software?. Kindly provide your email id if possible. Thanks
Пікірлер: 29