This is a year-week-day method for the
Sequences can only be generated for
year-week-day vectors. If you need to generate week-based sequences,
you'll have to convert to a time point first.
seq(), exactly two of the following must be specified:
# S3 method for clock_year_week_day seq(from, to = NULL, by = NULL, length.out = NULL, along.with = NULL, ...)
"year"precision year-week-day to start the sequence from.
fromis always included in the result.
[clock_year_week_day(1) / NULL]
"year"precision year-week-day to stop the sequence at.
tois cast to the type of
tois only included in the result if the resulting sequence divides the distance between
[integer(1) / clock_duration(1) / NULL]
The unit to increment the sequence by.
byis an integer, it is transformed into a duration with the precision of
byis a duration, it is cast to the type of
[positive integer(1) / NULL]
The length of the resulting sequence.
[vector / NULL]
A vector who's length determines the length of the resulting sequence.
length.out = vec_size(along.with).
These dots are for future extensions and must be empty.
# Yearly sequence x <- seq(year_week_day(2020), year_week_day(2026), by = 2) x #> <year_week_day<Sunday><year>> #>  "2020" "2022" "2024" "2026" # Which we can then set the week of. # Some years have 53 weeks, some have 52. set_week(x, "last") #> <year_week_day<Sunday><week>> #>  "2020-W53" "2022-W52" "2024-W52" "2026-W52"