【问题标题】:How does the heatmap function in R cluster the data an how can we get the number of groups?R中的热图功能如何对数据进行聚类,我们如何获得组数?
【发布时间】:2014-01-27 14:43:52
【问题描述】:

我有一个用heatmap 函数绘制的距离矩阵。热图函数将数据聚类到组中。我想将它们聚集到同一个组中。

参数是:

heatmap(distanceMatrix, symm = T)

数据组在矩阵的诊断中很明显。

类似这样的:

其实我是在找组数。之后我可以在 R 中使用 hclustecut 对数据进行分区。

【问题讨论】:

    标签: r cluster-analysis heatmap


    【解决方案1】:

    你看过函数的帮助文件(`?heatmap)吗?请参阅以下论点。

    distfun 
    function used to compute the distance (dissimilarity) between both rows and columns. Defaults to dist.
    
    hclustfun   
    function used to compute the hierarchical clustering when Rowv or Colv are not dendrograms. Defaults to hclust. Should take as argument a result of distfun and return an object to which as.dendrogram can be applied.
    

    【讨论】:

    • 谢谢,我正在寻找组数。已编辑。
    【解决方案2】:

    library(NbClust) 包解决了这个问题

    “NbClust:确定集群数量的指标检查:NbClust 包”

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-05
      • 2016-04-04
      • 1970-01-01
      • 2017-01-28
      相关资源
      最近更新 更多