Suppose you have a yearmonth and want to convert this into a yearquarter, or perhaps a date.
A consistent approach for this could be to always convert to the first value within the desired granularity.
So 1970 Jan would become 1970-01-01 (first day in 1970 Jan), or 1970 Q1 (only quarter containing Jan).
Some concepts could be drawn from 'precision' as used in vctrs casting, where precision reflects the granularity here.
Suppose you have a yearmonth and want to convert this into a yearquarter, or perhaps a date. A consistent approach for this could be to always convert to the first value within the desired granularity. So
1970 Jan
would become1970-01-01
(first day in 1970 Jan), or1970 Q1
(only quarter containing Jan).Some concepts could be drawn from 'precision' as used in vctrs casting, where precision reflects the granularity here.