This is the output I am aiming for where z
will provide a plot of mine with an x-axis.
z<-c("2014-01", "", "", "2014-04", "", "", "2014-07", "", "","2014-10", "", "", "2015-01")
The plot will be produced once a month and I aim on automating the axis creation. 2015-01 is my last available data point and the plot will display a span of 1 year back to 2014-01. Next update will make me want to set the plot to 2015-02 to 2014-02.
As can be seen, the labelling of the axis goes back in 3 month steps, leaving the ticks in between empty.
Can I automate this process by providing just the latest label 2015-02 and the rest gets deducted by R somehow?
I was thinking maybe to convert my starting point 2015-01 to a date Format and sequence it back to 2014-01. Then making it a character again and using it for the axis...
myz <- as.Date(c("2014-01", "2015-01"), "%Y - %m")
But myz is empty. And ofc the problem with the empty tick is far froms olved.
Any advice?