# seq.clock_year_day: Sequences: year-day In clock: Date-Time Types and Tools

## Description

This is a year-day method for the `seq()` generic.

Sequences can only be generated for `"year"` precision year-day vectors.

When calling `seq()`, exactly two of the following must be specified:

• `to`

• `by`

• Either `length.out` or `along.with`

## Usage

 ```1 2``` ```## S3 method for class 'clock_year_day' seq(from, to = NULL, by = NULL, length.out = NULL, along.with = NULL, ...) ```

## Arguments

 `from` `[clock_year_day(1)]` A `"year"` precision year-day to start the sequence from. `from` is always included in the result. `to` `[clock_year_day(1) / NULL]` A `"year"` precision year-day to stop the sequence at. `to` is cast to the type of `from`. `to` is only included in the result if the resulting sequence divides the distance between `from` and `to` exactly. `by` `[integer(1) / clock_duration(1) / NULL]` The unit to increment the sequence by. If `to < from`, then `by` must be positive. If `to > from`, then `by` must be negative. If `by` is an integer, it is transformed into a duration with the precision of `from`. If `by` is a duration, it is cast to the type of `from`. `length.out` `[positive integer(1) / NULL]` The length of the resulting sequence. If specified, `along.with` must be `NULL`. `along.with` `[vector / NULL]` A vector who's length determines the length of the resulting sequence. Equivalent to `length.out = vec_size(along.with)`. If specified, `length.out` must be `NULL`. `...` These dots are for future extensions and must be empty.

## Value

A sequence with the type of `from`.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10``` ```# Yearly sequence x <- seq(year_day(2020), year_day(2040), by = 2) x # Which we can then set the day of to get a sequence of end-of-year values set_day(x, "last") # Daily sequences are not allowed. Use a naive-time for this instead. try(seq(year_day(2019, 1), by = 2, length.out = 2)) as_year_day(seq(as_naive_time(year_day(2019, 1)), by = 2, length.out = 2)) ```

clock documentation built on April 23, 2021, 1:06 a.m.