When I use ggplot and try to change the legend name from "value" to "Work schedules" doesn't change. As well the scale 0 - Did not worked; 1-Did worked. Do you know what could be wrong with my code:
plot <- ggplot(df3, aes(x = time, y = index, fill = value)) + 
  geom_raster() + 
  facet_grid(~ day) + 
  theme(panel.spacing = unit(1, "mm"), 
        axis.text.x = element_text(angle = 90, hjust = 1)) + 
  labs(x="Hours", y ="Identification Number") + 
  scale_x_continuous(breaks =  c(9,17), name= "Time") + 
  scale_y_continuous() 
plot + annotate("rect", fill = "red", alpha = 0.5, xmin = c(9), xmax = c(17), ymin = -Inf, ymax = Inf) + 
  ylab ("Identification number") + 
  theme_bw()

 
     
    