Builds a run of years (YYYY) or months (YYYYMM) for use in
selections. Selections match these to a table's time labels whatever
format the table uses, so "202403" selects "2024-03", "2024M3" or
"2024.03".
Usage
nso_period_seq(start, end, by = c("Y", "M"))
Arguments
- start, end
Start and end periods as character (YYYY or YYYYMM).
- by
'Y' for yearly or 'M' for monthly.
Value
Character vector of periods.
Examples
# Generate yearly sequence
nso_period_seq("2020", "2024", by = "Y")
#> [1] "2020" "2021" "2022" "2023" "2024"
# Generate monthly sequence
nso_period_seq("202401", "202406", by = "M")
#> [1] "202401" "202402" "202403" "202404" "202405" "202406"