问题
I am using the R heatmaply package to produce interactive heatmaps. I like the software, but I would like to get from it the same clustering (ordering of rows and columns) I get using the pheatmap package. Therefore, I would like the two commands to produce the same ouput:
heatmaply (scale (mtcars))
pheatmap (scale (mtcars))
Is there a way to do this? Thanks in advance. Arturo
P.S. I recently asked another similar question about the color output, i.e., not clustering, output, that was brilliantly answered here: R heatmaply and pheatmap output
回答1:
Here is a solution to order columns and rows of heatmaply
as in pheatmap
:
phtmap <- pheatmap(scale(mtcars))
heatmaply(scale(mtcars), Rowv=phtmap[[1]], Colv=phtmap[[2]], revC=TRUE)
The ouput of pheatmap
and the output of heatmaply
来源:https://stackoverflow.com/questions/61935135/clustering-in-pheatmap-and-heatmaply-r-packages