I am trying to annotate data points in pheatmap. Everything works fine up until plotting the heatmap.
data <- as.matrix(Round_1)
library(pheatmap)
df = data.frame(Annotation)
colnames(df) = colnames(data)
pheatmap(data, cluster_rows = FALSE, cellwidth = 10, cellheight = 12,annotation_col = df)`
For the last line, I get an error: Error in RColorBrewer::brewer.pal(n, pal) : NA is not a valid palette name for brewer.pal
I do not even use the RColorBrewer package nor specify any color. If I do use the RColorBrewer library and specify an annotation colour, I get the following error:
Error in annotation_colors[[names(annotation)[i]]] <- brewer_pal("seq", :
more elements supplied than there are to replace
As for the independent column annotation, I have 3 clusters; each data point should belong to one.