Custom time periods

Hello community,

I am working with a dataset with about 69,000 observations over a 12-year period. Observations are linked to a date-variable (format: "2012-10-27"). I am trying to make a new column where observations made between the 18th of the first month and the 17th of the following month are lumped together (i.e. where "2012-10-27", "2012-11-04" & "2012-11-14" all would be labelled as "2012-OctNov" and "2012-11-18" & "2012-12-15" belong to "2012-NovDec" etc.) for all 12 years coming out to 12*12 = 144 labels I guess.

I have googled and looked through previous questions, but I can't seem to find any leads. I'm not sure which categories this question falls under, but I hope someone can help!

You can create a custom indexing function to use with tsibble package, see this related thread:

Not simple solution comes to my mind at this moment for the custom function, but I have a hunch that there must be one. If my brain wakes up later and I figure it out I will come back with more specific help.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.