【问题标题】:difference between corrplot and pheatmap of correlation matrix? how to make it consistent between the twocorrplot和相关矩阵的pheatmap之间的区别?如何使两者之间保持一致
【发布时间】:2021-09-15 15:54:32
【问题描述】:

我注意到 corrplot 制作的相关图与 pheatmap 制作的相关图不同。 原始数据: enter link description here

corrplot 中的相关矩阵,

count = read.csv('data_here.csv') 
mtx = cor(count, method = 'kendall')

corrplot(mtx, method="color", tl.cex = .35, 
         order="hclust", hclust.method = 'complete')

想在绘图的轴上添加树状图,但使用 ccorrplot 没有弄清楚... 所以我尝试了 pheatmap,

mtx %>% pheatmap(
fontsize = 3,
clustering_method = 'complete')

很明显,这两个包的聚类方式不同。例如,基因 RSPO3

【问题讨论】:

    标签: correlation r-corrplot pheatmap


    【解决方案1】:

    受这篇文章的启发, https://www.datanovia.com/en/blog/clustering-using-correlation-as-distance-measures-in-r/

    这样想出来的!

    pheatmap(mtx,
    fontsize = 3,
    clustering_distance_cols = as.dist(1 - mtx),
    clustering_distance_rows = as.dist(1 - mtx)
    )
    
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-07
      • 2022-01-17
      • 2017-02-12
      • 1970-01-01
      • 1970-01-01
      • 2017-01-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多