0

I cannot seem to find a thread relating to my issue (in simple terms at least).

I have a community matrix of species (columns) by sample sites (rows). I firstly performed a Bray-Curtis transformation to get a similarity/dissimilarity matrix (vegdist) and secondly, applied hclust function to the matrix.

Section of script I used:

library(vegan)
community_matrix <- read.csv(choose.files(),sep=",",row.names=1)
d = (1 - vegdist(community_matrix, method="bray")) * 100
h = hclust(d, method = "ward.D2")
plot(h, main = "", sub = "", xlab="", ylab = "Bray-Curtis simmilarity", axes = FALSE, hang = -1)

Everything works perfect however, the above resulted in a dendrogram tree with 127 branches (one for each sample site). I want to rather group the 127 sample sites by 5 HABITATS these sites belong to. Then the dendrogram's branches would show a more understanding, 5-branched (habitats) dendrogram instead of sample sites. Thus, clustering must be performed on the habitats and weighted by sample sites.

I performed this analysis before in PC-ORD but this time it must be done in unforgiving R.

ekad
  • 14,436
  • 26
  • 44
  • 46
Rion Lerm
  • 19
  • 5
  • Welcome to SO. You'll most likely get more & better answers if you'd provide a reproducible example instead of just describing what you got. Luckily, R makes it easy for you ;-) http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – lukeA Apr 28 '15 at 09:15

1 Answers1

0

Aggregate your data.

If you want to cluster habitats, your data should be on habitats, not sites.

However, if the habitat structure does not emerge from the sites, the similarity of habitats may be not very substantial / well-supported by the data (or the data is not preprocessed well enough).

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194
  • The cluster generated from the 127 sites is all over the place and there seems to be some mixing of different habitats' sites alongside those of others. Only pooled data will really show how closely related the habitats are based on bird species. Thanks! – Rion Lerm May 04 '15 at 05:49
  • Then it may be interesting to treat this as a misclassification problem instead. Compare habitats to their group average, and to the averages of other groups h most similar sites. – Has QUIT--Anony-Mousse May 04 '15 at 06:03