Hello, I have a metadata file with many categorical variables. I want to make like a heatmap (using R) so I can show my variables in a more compelling way in a slide for my students.
I tried ComplexHeatmap, but I could not get it to color each row separately.
For example (a smaller version of my metadata):
meta <- data.frame(tissue = c("liver", "liver", "heart, "heart", "lung"),
drug = c("PMX", "PMX", "PMX", "Ctr", "Ctr"),
age = c("12mo", "12mo", "6mo", "6mo", "6mo"),
model = c("mm10", "mm10", "mm10", "mm10", "mm10")
I would like a heatmap in which:
- each column above (tissue, drug, age) is a row of the heatmap
- each row would have its own legend
- each row would have its own set of colors per factor
For example my output would be a heatmap:
- row 1 (tissue) would have liver in green, heart in red, lung in yellow
- row 2 (drug) would have PMX in blue and Ctr in gray
- row3 would have 12mo in pink and 6mo in purple
- row 4 would be all orange (mm10) If possible all rows separated by a white line, or somthing similar
Can someone please help?
Thank you!
Sorry, I am trying, but I cant plot an empty heatmap. It doesnt work... I am very new to R. Can you please help? Thanks
Sorry, you don't have to draw a heatmap at all, you can
draw
annotations, for instance: