How to split a heatmap at specific row?
1
0
Entering edit mode
13 months ago
S20 • 0

I am trying to build a heatmap in R. I wanted to split the heatmap at specific rows. For example my matrix is as:

ID A B C

FD_1 0.3 0.2 1

FD_2 0.4 1 0.9

FD_3 0.6 0.8 0.2

FS_1 0.3 0.2 1

FS_2 0.4 1 0.9

FS_3 0.6 0.8 0.2

FS_4 0.4 1 0.9

FS_5 0.6 0.8 0.2

FE_1 0.3 0.2 1

FE_2 0.4 1 0.9

FE_3 0.6 0.8 0.2

FE_4 0.4 1 0.9

I want to make a heatmap that includes 3 slice: one for 3 FD, one for 5 FS and one for 4 FE. And label each slice with their name as FD, FS and FE.

I'm using this code:

Heatmap(M_matrix, name = "level", row_split = M_matrix$ID)

But it is not working!

Any suggestion? Thanks

R Heatmap Split • 1.3k views
ADD COMMENT
1
Entering edit mode
13 months ago

ComplexHeatmap should help you. Otherwise subset your data frame into three DFs and make threes separate heatmaps and use grid functionality of r.

ADD COMMENT

Login before adding your answer.

Traffic: 1318 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6