1nf2 <- mutate(nf, wd = wday(date, label = TRUE))
2nf2 <- mutate(nf2, wd = factor(wd))
3nf2 <- mutate(nf2, mw = factor(monthweek(day, wday(date))))
4nf2 <- mutate(nf2, mw = factor(mw, rev(levels(mw))))
5
6ggplot(nf2, aes(x = wd, y = mw, fill = n)) +
7 geom_tile(color = "white") +
8 scale_fill_gradient(low = "white") +
9 facet_wrap(~ month(date, TRUE)) +
10 ylab("") + xlab("Week of Month") +
11 theme(panel.grid.major = element_blank(),
12 axis.text.x = element_text(angle = 45, hjust = 1))