A simple data type for storing year-isoweek dates in a human readable integer
format, e.g.: the 52nd isoweek of 2012 is stored as 201252. Supports simple
arithmetic operations such as + and - as well formatting.
date_yw(y, w) is_date_yw(x) as_date_yw(x)
| y | year |
|---|---|
| w | week (optional) |
| x | any R object |
date_yw returns an object of type date_yw
is_date_yw returns TRUE or FALSE depending on whether its
argument is of type date_yw or not.
as_date_yw attempts to coerce its argument to date_yw
date_yw(2013, 12)#> [1] "2013-W12"as_date_yw(201612)#> [1] "2016-W12"