![]() |
# Fig. 9.7.: Boxplot comparison Cu in B- and C-Horizon, moss, ohorizon
library(StatDA) data(bhorizon) data(chorizon) data(moss) data(ohorizon) # only samples from same locations in ALL layers: c.ind=NULL b.ind=NULL m.ind=NULL h.ind=NULL c.id=chorizon[,1] b.id=bhorizon[,1] m.id=moss[,1] h.id=ohorizon[,1] for (i in 1:1000){ if (sum(c.id==i)+sum(b.id==i)+sum(m.id==i)+sum(h.id==i)==4){ c.ind=c(c.ind,which(c.id==i)) b.ind=c(b.ind,which(b.id==i)) m.ind=c(m.ind,which(m.id==i)) h.ind=c(h.ind,which(h.id==i)) } } # Cu data c.Cu=chorizon[c.ind,"Cu"] b.Cu=bhorizon[b.ind,"Cu"] m.Cu=moss[m.ind,"Cu"] h.Cu=ohorizon[h.ind,"Cu"] pdf("fig-9-7.pdf",width=6,height=6) par(mfrow=c(1,1),mar=c(4,4,2,2)) boxplot(log10(c.Cu),log10(b.Cu),log10(h.Cu),log10(m.Cu), horizontal=T,xaxt="n", pch=3,cex=0.8,notch=T, xlab="Cu [mg/kg]", names=c("C-horizon","B-horizon","O-horizon","Moss"),cex.lab=1.2) axis(1,at=log10(a<-sort(c((10^(-50:50))%*%t(c(2,5,10))))),labels=a) dev.off() |