I am using this code:
library(tidyverse)
library(reshape)
mtcars <- melt(mtcars, id="vs")
mtcars$vs <- as.character(mtcars$vs)
ggplot(mtcars, aes(x=vs, y=variable, fill=value)) +
geom_tile()
How can I paste the mean values as text on each tile? I tried + geom_text(mtcars, aes(vs, variable, label=mean))
, but that does not work.
Also, how can I reverse the order of 0 and 1 on the x axis?