I am trying to make a heatmap for a correlation matrix. I would like the y and x axis labels to be according to variable. For example, in the square comparing total_sales
correlation with penetration
I would like it to say either penetration
and total_sales
on each axis. For some reason, the examples online have their y-axis labeled according to variable but mine is by row number. I've put a reproducible example below.
df_try <- data.frame(term = c("total_sales", "penetration", "Density"),
total_sales = c(NA, .75, .34),
penetration = c(.65, NA, .88),
Density = c(-.24, -.55, NA))
heatmaply_cor(
df_try,
xlab = "Features",
ylab = "Features",
k_col = 2,
k_row = 2
)
The heatmap has 2, 1, 3
on the y axis and Density
, penetration
, total_sales
on the x axis. I do not want it to say 2, 1, 3
, I would like it to say penetration
, total_sales
, Density
.