I have a dataframe, it contains dates and status at this date. Status ranges from -1 to 2. I would like to create a heat map (grouped by days of the week and number of the week in the year), which is not a problem.
My problem is i want the following color mapping:
-1 => gray
0 => white
1 => blue
2 => green
Any ideas?. Thank you!
EDIT: As requested a sample code below the way I would do it and it doesnt work for me:
breaks <- seq(-2,2,1)
pal <- c("gray","white","green","blue")
data <- sample(-1:2, 5*6, replace=T)
m <- matrix(unlist(data),ncol=6)
m
image(m,
col = c("gray","white","green","blue"),
breaks = c(-2,-1,0,1,2)
)