[R] Overlaying two matrices to create a heatmap

Mark Aquino aquino.m at husky.neu.edu
Wed Jun 1 16:37:18 CEST 2011


Hi,

I'm trying to construct a heatmap using two matrices rather than one (Is this possible?)

For example, matrix1: (color range black---> blue)
acr	DPA1-0103	DPA1-0104	DPA1-0201	DPA1-0202	DPA1-0301
DPA1-0103	17	0	2	1	0
DPA1-0104		0	0	0	0
DPA1-0201			1	0	0
DPA1-0202				0	0
DPA1-0301					0

matrix 2: (color range black---> magenta)
noacr	DPA1-0103	DPA1-0104	DPA1-0201	DPA1-0202	DPA1-0301
DPA1-0103	14	1	5	0	1
DPA1-0104		0	0	0	0
DPA1-0201			1	0	0
DPA1-0202				0	0
DPA1-0301					0

I'd like to create a separate color range for each and then overlay the two using some kind of additive color scheme so that if there are equally high numbers in a certain field the heatmap would display whatever color blue and magenta is (yellow I think).


More information about the R-help mailing list