This is pretty easy with vegan , and I have a post that explains some of these details, but not a bit about clustering.
Here is a brief example, I assume that you can translate it to all the packages / code you use.
Download package and dataset
require(vegan) data(dune)
Calculate the difference matrix and copy it, cutting the dendrogram to give 3 groups
dij <- vegdist(dune) ## bray curtis dissimilarity clu <- hclust(dij, method = "average") grp <- cutree(clu, 3)
Look grp
R> grp 2 13 4 16 6 1 8 5 17 15 10 11 9 18 3 20 14 19 12 7 1 1 1 2 1 1 1 1 3 2 1 1 1 1 1 2 2 3 1 1
and note that now this gives the cluster membership (second row) for each sample (top row) in the dataset.
Next install NMDS
set.seed(2)
In this example, I will color the dots according to cluster membership, so I need to define a color vector, one per cluster
col <- c("red2", "green4", "mediumblue")
Now I can use grp and col to create a vector of color names for each point (selection) I am indexing on col with grp . For instance:.
R> col[grp] [1] "red2" "red2" "red2" "green4" "red2" [6] "red2" "red2" "red2" "mediumblue" "green4" [11] "red2" "red2" "red2" "red2" "red2" [16] "green4" "green4" "mediumblue" "red2" "red2"
All remains are to draw an NMDS order and add points and legend. I suppress any construction in the plot() call, so I can have more control over adding points on the next line. The third line just adds the legend.
plot(ord, type = "n", display = "sites") points(ord, col = col[grp], bg = col[grp], pch = 21) legend("topright", legend = paste("Cluster", 1:3), col = col, pt.bg = col, bty = "n", pch = 21)
The resulting figure should look like this:

Refresh . To add convex hulls for each cluster of points to the ordination diagram, you can use the ordihull() function. Continuing the example above, we add convex hulls as follows
ordihull(ord, groups = grp, display = "sites")
At this point, the drawing will look like the one shown below

Note : vegan methods of a higher level plot() are designed specifically for quick and dirty display of ordination and, as such, do not accept color vectors or graphic symbols. instead, we expect you to create lower-level flow methods for your graphs, such as points() , which I use here.