I am plotting a heatmap using pheatmap (Documentation). I am plotting a matrix in a fairly straightforward way:
pheatmap(mat, a
I figured this out, hopefully if anyone has this problem in the future it will help.
This happens when you are using the labels_col= argument of pheatmap. In my scenario, which was a RNA-seq project using DESeq2, there was a targets file identifying the samples (columns), but for my column labels I was using a different column so the labels were more understandable, so I used
labels_col=myThing$ThisOtherColumn
The other column, while actually a string containing characters and numbers, for some reason was being read as an integer vector. So the solution was to do
as.character(myThing$ThisOtherColumn)
As long as you give labels_col a character vector it will adjust the columns automatically.