I am working on SOM and is generating heatmaps using the palette coolBlueHotRed.
The default coolBlueHotRed is this
coolBlueHotRed <- function(n, alpha = 1) {
rainbow(n, end=4/6, alpha=alpha)[n:1]
}
I am using Shane Lynn R scripts to conduct this SOM/heatmap plotting and in it uses the plotHeatMap() function which takes in this palette coolBlueHotRed inside the script. An example of the heat map.
This heat map uses the coolBlueHotRed, which works perfectly fine. But, I will like to overlay this heat map with my class attribute to see how skew the class attribute is on the heat map.
Is there a way to modify this function such that the color can be based on my class attribute? I have a class attribute called car_type with 3 categorical data which are "1", "2" and "3".
question from:
https://stackoverflow.com/questions/65866286/modify-coolbluehotred-to-be-based-on-class-attribute 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…