0
A
回答
0
一種方法是直接重現數據聚類。 pheatmap
的默認輸入參數指定歐幾里德距離和層次聚類。
下面的代碼重現了pheatmap
將在測試矩陣上執行的聚類。 reordered
的內容是由pheatmap
繪製的內容。
# load clustering library
library(stats)
# example matrix from pheatmap documentation
test = matrix(rnorm(200), 20, 10)
test[1:10, seq(1, 10, 2)] = test[1:10, seq(1, 10, 2)] + 3
test[11:20, seq(2, 10, 2)] = test[11:20, seq(2, 10, 2)] + 2
test[15:20, seq(2, 10, 2)] = test[15:20, seq(2, 10, 2)] + 4
colnames(test) = paste("Test", 1:10, sep = "")
rownames(test) = paste("Gene", 1:20, sep = "")
# cluster and re-order rows
rowclust = hclust(dist(test))
reordered = test[rowclust$order,]
# cluster and re-order columns
colclust = hclust(dist(t(test)))
reordered = reordered[, colclust$order]
相關問題
- 1. R:使用索引矩陣從數組中提取矩陣
- 2. 從矩陣中提取數據
- 3. 從R中的矩陣列表中獲取矩陣的維數
- 4. 從矩陣列表中提取矩陣
- 5. 從列表中的矩陣中提取一列R
- 6. 如何提取R中矩陣中的鏈接數?
- 7. 從有序相關矩陣中提取的順序列表,R
- 8. 提取從矩陣陽性元素中的R
- 9. 使用列號向量從R數據幀/矩陣中提取「鋸齒狀」列
- 10. 在C++中從矩陣中提取列
- 11. 在數據幀的子矩陣R中
- 12. 從矩陣中提取的數據點和在MATLAB
- 13. Excel,從矩陣中獲取數據
- 14. 使用R從距離矩陣中提取對角線
- 15. 你如何提取嵌套JSON數據數據中的R
- 16. 矩陣R從數字轉換爲csv中提供的字符
- 17. 使用Python比較/從矩陣中提取數據(2.6.1)
- 18. 如何使用矩陣值從字典中提取列數據?
- 19. 從numpy矩陣中提取一行
- 20. 從TXT文件中提取矩陣
- 21. 從模型視圖矩陣中提取比例矩陣
- 22. 從另一個矩陣中提取矩陣值
- 23. 在數據矩陣R
- 24. 從R中的矩陣中提取完整的配對值(非NA)
- 25. 提取矩陣
- 26. 取矩陣中行的平均值r
- 27. 從R中提取JavaScript數據
- 28. 從logistf中提取數據R
- 29. 創建從數據幀不同的矩陣,其中R爲環
- 30. 從3D單元陣列爲二維矩陣中提取數據 - MATLAB
如果將熱圖保存爲對象,則可以訪問數據。看看結構('str()'),它可能就在那裏 – erasmortg