So instead of using the rownames from my matrix as the row labels, I want to use a different set of non-unique labels. (The nuance here is that I can't set these labels as the rownames in the matrix, since they aren't unique. - I'm hoping that using the labRow option will allow me to circumvent that.)
labRow = df1$type where df1$name matches rowname of x
I think it might require something a little more complicated, like found here: Make row labels italic in heatmap.2
DF1
name type
1 Mazda RX4 A
2 Mazda RX4 Wag A
3 Datsun 710 B
4 Hornet 4 Drive B
5 Hornet Sportabout B
6 Valiant C
7 Duster 360 A
8 Merc 240D B
9 Merc 230 C
10 Merc 280 C
Heatmap:
data(mtcars)
x <- as.matrix(mtcars)
heatmap.2(x)
Not sure how to accomplish this within heatmpa.2. Wondering if it would be by using merge? Or something else?
Desired output would be a heatmap with the row labels being they type instead of car name.