Description Usage Arguments References Examples
Date, POSIXct, and POSIXlt are converted directly. Any day, hour, minute,
or second components are dropped. POSIXct and POSIXlt are converted to
dates via as.date()
with the timezone respected.
Character input is assumed to be provided in either ISO 8601 standard format, i.e. "yyyy-mm-dd", or yrwk format, i.e. "yyyy-Www". On conversion the day component will be dropped.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | as_yrwk(x, firstday = 1L, ...)
## Default S3 method:
as_yrwk(x, firstday = 1L, ...)
## S3 method for class 'yrwk'
as_yrwk(x, ...)
## S3 method for class 'Date'
as_yrwk(x, firstday = 1L, ...)
## S3 method for class 'POSIXt'
as_yrwk(x, firstday = 1L, ...)
## S3 method for class 'character'
as_yrwk(x, firstday = 1L, ...)
## S3 method for class 'factor'
as_yrwk(x, firstday = 1L, ...)
|
x |
'An object to coerce to yrwk. |
firstday |
An integer representing the day the week starts on from 1 (Monday) to 7 (Sunday). |
... |
Not used. |
The algorithm to convert between dates and yrwk, builds upon the work of Xiahong Zhao in the EpiWeek package and Zhian Kamvar in the aweek package.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.