

For more details on this please check this R blog. Briefly, we will flag out the lines that lie outside 1.5*IQR, where IQR, the âInter Quartile Rangeâ is the difference between 75th and 25th quartiles, these are observation that are outside the whiskers in box plot.As the data is in Augmenetd RCBD un-replicated uni-variate approach will be used to find the potential outliers.> # First let us visualize the data using boxplots > myboxplot% + filter( ! is.na( !! aaa), ! is.na( !! bbb)) %>% + #group_by(!! aaa,!! bbb) %>% + #count() %>% + ggplot( aes_( fill=aaa, x=aaa, y=bbb)) + + theme_classic() + + geom_boxplot() + + theme( = element_text( angle = 45, hjust = 1)) + # fill by timepoint to give different color + #scale_fill_manual(values = c("", ""))+ + #scale_color_manual(values = c("", "")) + theme ( plot.title = element_text( color= "black", size= 12, hjust= 0.5, face = "bold"), # add and modify the title to plot + = element_text( color= "black", size= 12, face = "bold"), # add and modify title to x axis + = element_text( color= "black", size= 12, face= "bold")) + # add and modify title to y axis + #scale_y_continuous(limits=c(0,15000), breaks=seq(0,15000,1000), expand = c(0, 0))+ + theme( axis.text= element_text( color = "black", size = 10)) + # modify the axis text + theme( legend.title = element_text( colour= "black", size= 16), legend.position = "none", + legend.text = element_text( colour= "black", size= 14)) + # add and modify the legends + guides( fill= guide_legend( title= "Environments")) + + stat_summary( fun.y=mean, geom= "line", aes( group= 1)) + + stat_summary( fun=mean, geom= "point") + } > # Now draw the box plot for yield > p1 #p1 > # Now draw the box plot for flowering > p2 #p2 > # Now draw the box plot height > p3 #p3 #p1+p2+p3 > par( mfrow= c( 1, 3)) > p1 p2 p3 subplot(p1, p2, p3, nrows= 1, margin = 0.05, titleY = TRUE) # Summary for GRAIN YIELD > summary.gykgpha% + group_by(Environment) %>% + summarize( Mean = mean(GYKGPHA, na.rm= TRUE), + Median= median(GYKGPHA, na.rm= TRUE), + SD = sd(GYKGPHA, na.rm= TRUE), + Min.= min(GYKGPHA, na.rm= TRUE), + Max.= max(GYKGPHA, na.rm= TRUE), + CV= sd(GYKGPHA, na.rm= TRUE) / mean(GYKGPHA, na.rm= TRUE) * 100, + St.err= sd(GYKGPHA, na.rm= TRUE) / sqrt( length(GYKGPHA)) + )) > summary.gykgpha > summary.gykgpha # Summary for FLOWERING DATA > summary.flowering% + group_by(Environment) %>% + summarize( Mean = mean(Days.to.flowering, na.rm= TRUE), + Median= median(Days.to.flowering, na.rm= TRUE), + SD = sd(Days.to.flowering, na.rm= TRUE), + Min.= min(Days.to.flowering, na.rm= TRUE), + Max.= max(Days.to.flowering, na.rm= TRUE), + CV= sd(Days.to.flowering, na.rm= TRUE) / mean(Days.to.flowering, na.rm= TRUE) * 100, + St.err= sd(Days.to.flowering, na.rm= TRUE) / sqrt( length(Days.to.flowering)) + )) > summary.flowering summary.flowering # Summary for PLANT HEIGHT > summary.height% + group_by(Environment) %>% + summarize( Mean = mean(Height, na.rm= TRUE), + Median= median(Height, na.rm= TRUE), + SD = sd(Height, na.rm= TRUE), + Min.= min(Height, na.rm= TRUE), + Max.= max(Height, na.rm= TRUE), + CV= sd(Height, na.rm= TRUE) / mean(Height, na.rm= TRUE) * 100, + St.err= sd(Height, na.rm= TRUE) / sqrt( length(Height)) + )) > summary.height # Now combine the all data summeries and view as table > summary.data summary.data # Add options to print and export > print_table(summary.data, rownames = FALSE, caption = htmltools ::tags $ caption( "Data summary including mean, median, standard deviation (SD), coefficient of variation (CV), and standard error (St.err) for yield, days to flowering and plant Height.", style= "color:black font-size:130%"))
