I faced a very weird error, possibly a bug in R 3.5.1
or pheatmap
The following code is working fine:
rownames(df) <- colnames(mat)
xx <- pheatmap(mat, annotation_col=df)
But the following is not working:
rownames(df) <- str_sub(colnames(mat), 1, -3)
xx <- pheatmap(mat, annotation_col=df)
Everything just looks perfect, but it is giving the error:
Error in check.length("fill") : 'gpar' element 'fill' must not be length 0
I reloaded Rstudio
but the problem persists. Any modifications of rownames
of df
makes it impossible to draw the chart. I tried also substr
function.
Does anybody know why this is happening?
df
andmat
. – Russcolnames(mat) <- str_sub(colnames(mat), 1, -3)
– Fibrosis