Dear R users,
x-values (EI) = Adw, EG1, LA1, Ad1, LA2, LA3...(14 levels, insect stages) y-valus = antpop within the boxplot function x-values are ordered alphabetically Idea: x-values ranked by list order (insect stage: Egg stage 1 is followed by Larvae 1 and not by Egg stage 2 as it would be in an alphabetically order) Problems with the order(tapply()) function: variable lengths differ thanks Sibylle R-code (as later insect stages have higher means, ordering was based on mean or median...) SOPRA<-read.table("SOPRA206_WG_WAE.txt", na.strings="0", header=TRUE) ordered<-order(tapply(SOPRA$antpop, SOPRA$EI, mean)) boxplot(antpop~ordered, data=SOPRA, boxwex=0.20, at=1:14-0.2, scales=list(x=list(rot=45)), notch=TRUE, xlab = "EVENT", ylab = "DOY", ylim = c(100,350), yaxs ="i", col="red", subset=(wg == "ctrl")) boxplot(antpop~ereignis, data=SOPRA, add=TRUE, boxwex=0.20, at=1:14+0.2, xaxt="n", notch=TRUE, col="blue", subset=(wg == "scen")) legend(1,330, c("SOPRA206 WGctrl", "SOPRA206 WGscen"), fill=c("red", "blue"), bty="n") text(1,340, "Waedenswil", font=2, pos=4) [[alternative HTML version deleted]] ______________________________________________ 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.