In this example R heatmap ggplot2 ordered as data file
I've changed data input to this one where for the second column every value is 0 so it should we filled in white
people,1,2,3
Ej1,1,0,0
Ej2,0,0,1
Ej3,0,0,1
Ej4,1,0,0
Using the same code as in the post
library(reshape2)
library(ggplot2)
library(scales)
library(plyr)
data <- read.csv("fruits.txt", head=TRUE, sep=",")
data$people <- factor(data$people,levels=rev(data$people))
data.m = melt(data)
data.m <- ddply(data.m, .(variable), transform, rescale = rescale(value))
data.m <- ddply(data.m, .(variable), transform, rescale = rescale(value))
p <- ggplot(data.m, aes(variable, people)) + geom_tile(aes(fill = rescale),
colour = "white")
p + scale_fill_gradient(low = "white", high = "steelblue")
But the X2 variable column is filled with a different color instead of white as shown in the image.
I've been trying to change the scale_fill_gradient(low = "white", high = "steelblue") to the scale_color_gradient but couldn't find out how.

