# import of data via clipboard
veg.data <- read.delim ('clipboard', row.names = 1)
env.data <- read.delim ('clipboard', row.names = 1)
# calculating distance matrix (square root transformation of data)
dis <- dist (sqrt (veg.data), 'euclidean')
# classification using ward
cluster.ward <- hclust (dis, 'ward')
# plotting the dendrogram
plot (cluster.ward)
# plotting the boxes around
rect.hclust (cluster.ward, k = 5, border = 'blue')
# boxplot with differences in pH
cl <- cutree (cluster.ward, k = 5)
boxplot (env.data$pH.H ~ as.factor (cl), xlab = 'Group', ylab = 'pH')