# add group names at centroids of an mds plot ordicentroid <- function(mds, labels) { x <- mds$points[,1] y <- mds$points[,2] mx <- tapply(x, labels, mean) my <- tapply(y, labels, mean) text(mx, my, names(mx)) }