简体   繁体   English

聚类分析,不按组/居住地划分树状图

[英]Cluster analysis, dendrogram by group/habitat not sample

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. 首先,我执行了Bray-Curtis变换以获得相似/不相似矩阵( vegdist ),其次,将hclust函数应用于矩阵。

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). 一切正常,但是,上面的结果形成了具有127个分支的树状图(每个示例站点一个)。 I want to rather group the 127 sample sites by 5 HABITATS these sites belong to. 我想将127个样本站点按5个属于这些站点的HABITATS进行分组。 Then the dendrogram's branches would show a more understanding, 5-branched (habitats) dendrogram instead of sample sites. 然后,树状图的分​​支将显示出更多的理解,而不是样本位置的5分支(栖息地)树状图。 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. 我之前曾在PC-ORD中进行过此分析,但是这次必须在无情的R中完成。

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). 但是,如果生境结构没有从这些地点出现,则生境的相似性可能不是非常实质/数据不能很好地支持(或者数据预处理得不够好)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM