My data take the structure of:
month <- c("May", "June", "July", "May", "June", "July")
year <- c("2015", "2015", "2015", "2016", "2016", "2016")
value <- c(1:3, 3:1)
df <- data.frame(month, year, value)
(The data actually go all the way from January to December for both years, this is just a short reproducible example.)
I'm doing a time series plot of value
using ggplot (Assume I can't use plot.ts()
for reasons which are too complicated to explain here). How do I layer the labels of the x axis, such that each tick mark is labeled with the month, but then below that there is another label below that with the year, so I get something like:
-------+-------+-------+----//---+-------+-------+-----
May June July May June July
2015 2016