powered by
The arithmetic operations +, - as well as sequence generation with seq() are all supported for date_yq and date_ym objects. Other binary arithmetic operators are disabled (see date_xx_arithmetic_disabled).
+
-
seq()
date_yq
date_ym
# S3 method for date_xx +(x, y)# S3 method for date_xx -(x, y)
# S3 method for date_xx -(x, y)
a date_yq or date_ym object
an integer
base::Arithmetic
q <- date_yq(2018, 1) q + 5 q - 1 seq(q, q + 5) m <- date_ym(2018, 12) m + 1 m - 13 seq(m - 1, m + 1)
Run the code above in your browser using DataLab