I have the dataframe below
DrugName <- c("as","df","fg","gh","jk") value <- c("AD","AD","AD","AD","SEL") MELT <- data.frame(DrugName, value)
and I want to create a heatmap that will have drug names as rows , and target symbols as columns (below the heatmap) and a grid square should be white if there is no association between a drug & a target
or black if there is an association between a drug & a target.
library(ggplot2) ggplot(MELT, aes(value, DrugName)) + geom_tile() + geom_tile(aes(fill = value), colour = "white") + scale_fill_manual(values = c("white", "black"))
I do not understand why the plot seems to have 3 column while the values are 2 and also why the coloring seems to be incorrect.