A registered map short-circuits the base-grid derivation in
calendar_map() (and thereby recast_calendar()) for one calendar
pair – the table analogue of the functional override in
register_calendar_conversion(), for cases where the exact correspondence is
known (provably nested calendars, hand-audited crosswalks).
Arguments
- from, to
Calendar names (
meta$name) the map applies to, orCalendarobjects (their names are used).- map
A
data.frameshaped like acalendar_map()result: the two label columns named afterfromandto, plusyear,n_from,n_overlapandw.NULLremoves a previously registered map.
Examples
m12 <- calendar_map(calendar("m12"), calendar("q4"), year = 2021)
register_calendar_map("m12", "q4", m12)
get_calendar_map("m12", "q4")
#> year m12 q4 n_from n_overlap w
#> 1 2021 m01 Q1 31 31 0.08493151
#> 2 2021 m02 Q1 28 28 0.07671233
#> 3 2021 m03 Q1 31 31 0.08493151
#> 4 2021 m04 Q2 30 30 0.08219178
#> 5 2021 m05 Q2 31 31 0.08493151
#> 6 2021 m06 Q2 30 30 0.08219178
#> 7 2021 m07 Q3 31 31 0.08493151
#> 8 2021 m08 Q3 31 31 0.08493151
#> 9 2021 m09 Q3 30 30 0.08219178
#> 10 2021 m10 Q4 31 31 0.08493151
#> 11 2021 m11 Q4 30 30 0.08219178
#> 12 2021 m12 Q4 31 31 0.08493151
list_calendar_maps()
#> key from to
#> 1 m12->q4 m12 q4
register_calendar_map("m12", "q4", NULL) # remove again
