`R/gregorian-year-month-weekday.R`

`year-month-weekday-arithmetic.Rd`

These are year-month-weekday methods for the arithmetic generics.

Notably, *you cannot add days to a year-month-weekday*. For day-based
arithmetic, first convert to a time point with `as_naive_time()`

or
`as_sys_time()`

.

# S3 method for clock_year_month_weekday add_years(x, n, ...) # S3 method for clock_year_month_weekday add_quarters(x, n, ...) # S3 method for clock_year_month_weekday add_months(x, n, ...)

x |
A year-month-weekday vector. |
---|---|

n |
An integer vector to be converted to a duration, or a duration
corresponding to the arithmetic function being used. This corresponds
to the number of duration units to add. |

... | These dots are for future extensions and must be empty. |

`x`

after performing the arithmetic.

Adding a single quarter with `add_quarters()`

is equivalent to adding
3 months.

`x`

and `n`

are recycled against each other.

#> <year_month_weekday<day>[1]> #> [1] "2019-01-Fri[2]"#> <year_month_weekday<day>[5]> #> [1] "2019-02-Fri[2]" "2019-03-Fri[2]" "2019-04-Fri[2]" "2019-05-Fri[2]" #> [5] "2019-06-Fri[2]"# These don't necessarily correspond to the same day of the month as_year_month_day(add_months(x, 1:5))#> <year_month_day<day>[5]> #> [1] "2019-02-08" "2019-03-08" "2019-04-12" "2019-05-10" "2019-06-14"