create a lag vector of a Date vector
find the difference between original Date vector and its lag series created in the previous step.
difference to be in months
Welcome to the community!
Without any more details, it's hard to give you a solution. I think the following SO answer will be very helpful. You can look at the other answers on that thread too.
In case it doesn't solve your problem, please provide more details, preferably in form of a REPRoducible EXample](FAQ: What's a reproducible example (`reprex`) and how do I do one?).
In case you don't know how to make a reprex, here's a great link:
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.