I want to subtract months from given date in year and month format.
global_date = "2017-01"
I am converting it with the zoo
library as follows:
as.yearmon(global_date) - 0.1
but it gives me Nov 2016, I want it as '201612'
How can I do it in R?
As we want to subtract one month, we should subtract
1/12
which is0.083
and not0.1
If we need output in the mentioned format