Hi R Users, I am using following R code to plot a "grouped boxplot". I'm hoping if I can add MEAN to these boxplots. Data is copied below and attached as text file.
install.packages("ggplot2") library(ggplot2) dta<-read.table("Sample.txt",header=T) attach(dta) p <- ggplot(dta, aes(factor(month), nail)) p + geom_boxplot(aes(fill = factor(trt))) Data: month nail trt 6 7.2 1 12 9.3 1 0 5.8 1 1 6 1 2 6.5 1 3 7 1 6 9.1 1 12 7.9 1 0 3.3 1 1 4.9 1 2 1.4 2 3 2.7 2 6 3.7 2 12 9.4 2 0 3.1 2 1 2.7 2 2 5.4 2 3 8.3 2 6 12.3 2 12 17.7 2 Any help would be greatly appreciated, Thanks, Peng
month nail trt 6 7.2 1 12 9.3 1 0 5.8 1 1 6 1 2 6.5 1 3 7 1 6 9.1 1 12 7.9 1 0 3.3 1 1 4.9 1 2 1.4 2 3 2.7 2 6 3.7 2 12 9.4 2 0 3.1 2 1 2.7 2 2 5.4 2 3 8.3 2 6 12.3 2 12 17.7 2
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.