[英]R (package superheat) - adding color (or rectangles) to the dendrograms
Minimal example and package documentation ( https://rlbarter.github.io/superheat/ ):最小示例和 package 文档( https://rlbarter.github.io/superheat/ ):
library(superheat)
superheat(mtcars,
# scale the matrix columns
scale = TRUE,
left.label = "none",
# add row dendrogram
col.dendrogram = TRUE,
legend=F,
)
I would like to achieve two things:我想实现两件事:
I believe the dendrogram is created used ggdendro (if that may assist).我相信树状图是使用ggdendro创建的(如果有帮助的话)。
Consequently these are example of what I wanna achieve:因此,这些是我想要实现的示例:
The ggdendro package does not support branch colors, and in general it is no longer supported. ggdendro package 不支持分支 colors,一般不再支持。 It was superseded by the dendextend package (which includes the ggdend object, which does support branch colors, lwd and lty).它被 dendextend package(包括 ggdend object,它支持分支 colors、lwd 和 lty)取代。 You can prepare your dendrograms using dendextend and feed them into a heatmap.2 function from gplots.您可以使用dendextend 准备您的树状图并将它们输入到热图中。来自gplots 的2 function。 Alternatively, you can look into the heatmaply package.或者,您可以查看热图 package。
Good luck.祝你好运。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.