I'm trying to make a few heatmaps dynamically, however I'm having a bit of trouble when trying to make the annotation object.
According to the guides, you need to provide a named vector to the
col argument in
HeatmapAnnotation function, however I can't do that when generating dynamically, as there's different annotations. I've tried an un-named vector, but I get the following error every time:
Error in ColorMapping(name = name, colors = col, na_col = na_col) : either provide `levels` or provide named `colors`.
ha = HeatmapAnnotation(df = df, col = list(type = c("black", "red")))
Any suggestions? - I feel like I've missed something obvious but can't seem to nail it down.