我使用pheatmap包创建了一个基于层次聚类的具有相应树状图的热图。现在,我想更改树状图中叶子的顺序。最好使用最优叶子法。我已经四处搜索,但没有找到任何关于如何改变实现这一目标的解决方案。
我将不胜感激有关如何使用最佳叶子方法更改叶子顺序的建议。
这是我的带有随机数据的示例代码:
mat <- matrix(rgamma(1000, shape = 1) * 5, ncol = 50)
p <- pheatmap(mat,
clustering_distance_cols = "manhattan",
cluster_cols=TRUE,
cluster_rows=FALSE
)