I'm trying to make a heatmap based on that matrix:
1 2 3 4 5 6 7
C 6211 7608 8089 10514 7363 5375 7268
L 2459 2904 2573 3049 2221 1652 2311
N 3173 4213 3025 4324 2864 1524 2363
S 37 74 141 94 68 48 88
W 1223 1259 914 1691 874 607 912
I made it by:
c1 <- table(kat_data$delay_code, kat_data$DayOfWeek)
c1 <- as.matrix(c1)
c1
And now I'm trying to make a heatmap using heatmaply()
, but I got an error:
Error in levels<-(tmp`, value = as.character(levels)) : factor level [6] is duplicated
Part of the heatmap code below:
p<-heatmaply(c1,
dendogram = "none",
xlab = "", ylab = "",
main = "",
scale = "column",
margins =c(60,100,40,20),............
What should I do to make it work? I read a lot of questions with that error and I see that I need to provide unique data, but I don't know where and how to do this. Could you please help me?