data(sp2)
# convert into SoilProfileCollection and plot
# plotting order, based on the dated surface each soil was described on
p.surface <- as.numeric(aggregate(sp2$surface, by=list(sp2$id), unique)$x)
p.order <- order(p.surface)
depths(sp2) <- id ~ top + bottom
plot(sp2, plot.order=p.order)
# truncate plot to 200 cm depth, that looks better
plot(sp2, plot.order=p.order, max.depth=200)
# look at numerical distances between profiles
data(sp2)
d <- profile_compare(sp2, vars=c('prop','field_ph','hue','value'),
max_d=100, k=0.01, sample_interval=5)
# better plotting with ape package:
require(ape)
require(cluster)
h <- diana(d)
p <- as.phylo(as.hclust(h))
plot(ladderize(p), cex=0.75, label.offset=0.25)
# add in the dated surface type via color
tiplabels(col=p.surface, pch=15)
# based on distance matrix values, YMMV
legend(x=0, y=6.1, legend=levels(sp2$surface), col=1:6, pch=15, bty='n', bg='white')
Run the code above in your browser using DataLab