Hi,
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`.
Code:
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.
Thanks,
Hi, I was wanting to do this without a named vector, is there any way for the col argument to automatically take the first element of the vector, for the first level in the data frame column, for example?
Hi, now it is supported in the newest version. You can update it by `devtools::install_github("jokergoo/ComplexHeatmap")`
En, not in current version, but I will support it in future versions.