I am plotting a heatmap using pheatmap library from R. The code works fine and I get a nice heatmap with clusters. However, the color of the rows and columns are automatically selected. What I want is to preset the colors. As an example here is the code that I am using for plotting
pheatmap(dmat,border_color=NA,annotation_col=mr[,"Trt",drop=F],
annotation_row=mr[,"Response",drop=F],annotation_legend=T,fontsize_row = 5, fontsize_col = 5)
Where dmat is data matrix. I want to annotate the colors of the column based upon Treatment which has two levels (Drug1 & Drug2 ) and I want to color rows based upon response to Drug and has 4 levels (RD1,NRD1, RD2,NRD2). How can I tell the pheatmap function that a specific color scheme needs to be used.
Thank you in advance.