Reputation: 11
I am using heatmaply to create a heatmap but unfortunately my row labels are not showing as names. Row labels are row numbers. How can I make my row names from column 1 show on the heatmap ?
Here is my code:
the row names are still not showing as labels, but rather as numbers (1,2,3...):
heatmaply(mtcars, k_col =10, k_row =1, row.names(mtcars) <- mtcars[,1], cexRow = 0.1, cexCol=10, margins =c(100,100))
Please advise Thanks
Upvotes: 0
Views: 1094
Reputation: 11
Well the secret is using labRow= cars[,1] in the code as follows:
heatmaply(cars, k_col=14, k_row=1,labRow= cars[,1], cexRow=10, cexCol=10, margins=c(50,50), scale_fill_gradient_fun=ggplot2::scale_fill_gradient2(low="navy blue", high ="red",midpoint=1, limits=c(0,2.2)))
Upvotes: 0
Reputation: 224
I don't know what your heatmap should look like (I could not generate a map with the code you provided). However, I was able to generate a graph with the row labels (Mazda RX4, etc.) by simply removing row.names from your code:
heatmaply(mtcars, k_col =10, k_row =1, cexRow = 0.1, cexCol=10, margins =c(100,100))
Upvotes: 1