Many RowSideColor heatmap.2 columns from gplots package

I would like to be able to use two RowSideColor lines with the heatmap.2 function from the R-packet plots, but I cannot figure out how to do this. I saw this question asked before the stack overflowed, and although this question was answered, the answers did not affect the question. Adding factors to the input matrix will not work, because it will affect the results of hierarchical clustering. I am open to using other functions, such as heat maps, to achieve my goals, if necessary.

Thanks Brad

+5
source share
1 answer

I wanted to do this before and always used to make two heat maps, and copy and paste one RowSideColors bar from one heat map to another. I just did a bit of work and found the heatmap.plus package that can do this, though:

 # install.packages("heatmap.plus") #install package require("heatmap.plus") data(cars) # using cars data as example # create a matrix of colors for RowSideColors myCols = cbind(rep(c("yellow", "blue"), 25), rep(c("red", "green"), 25)) heatmap.plus(data.matrix(cars), RowSideColors=myCols) 

The RowSideColors argument in this package can accept a color matrix to overlay multiple colors in a row.

+7
source

Source: https://habr.com/ru/post/1201752/


All Articles